Interface AudioOutputPeer
public interface AudioOutputPeer
A platform audio output stream that pulls samples from an
AudioRenderCallback. Ports implement this and return it from
CodenameOneImplementation.openAudioOutput; applications use
AudioContext instead.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stops the stream for good and releases the device.intThe number of interleaved channels passed to the render callback.doubleThe time between a sample being rendered and it being heard, as well as the port can tell.intThe sample rate the device actually runs at, which may differ from the one requested.voidstart()Starts, or resumes, calling the render callback.voidstop()Pauses the stream; the render callback is not called untilstart().
-
Method Details
-
start
void start()Starts, or resumes, calling the render callback. -
stop
void stop()Pauses the stream; the render callback is not called untilstart(). -
close
void close()Stops the stream for good and releases the device. -
getSampleRate
int getSampleRate()The sample rate the device actually runs at, which may differ from the one requested.
Returns
frames per second
-
getChannels
int getChannels()The number of interleaved channels passed to the render callback.
Returns
the channel count
-
getOutputLatency
double getOutputLatency()The time between a sample being rendered and it being heard, as well as the port can tell.
Returns
the latency in seconds, or 0 when unknown
-