Interface IAudioStreamRecord
interface IAudioStreamRecord
Extends com.amazon.apmf.IStandard
Interface for encapsulating Audio Record functionality
Methods
initCheck()
bool initCheck()
Initialization state checking for record client object.
Returns
bool
true if the object was created and initialized successfully.
getAudioConfig()
AudioConfig getAudioConfig()
Get audio config
Returns
AudioConfig
configuration of the audio captured by the stream
getAudioSource()
AudioSource getAudioSource()
Get audio source
Returns
AudioSource
audio source type
getAudioFlags()
AudioFlags getAudioFlags()
Get audio flags
Returns
AudioFlags
audio flags used while creating the audio record stream
getNumBytesInPipeline()
i32 getNumBytesInPipeline()
Audio data in bytes pending to be copied by the client from server memory.
Returns
i32
pending number of data bytes between client and server on initialized object.
0 otherwise.
getMinBufferSizeInBytes()
i32 getMinBufferSizeInBytes()
Minimum number of bytes of audio sample to be copied from each read call.
Returns
i32
audio buffer size in bytes on initialized object. 0 otherwise.
getLatencyInMs()
i32 getLatencyInMs()
Latency in milliseconds from audio pipeline.
Returns
i32
latency in milliseconds on initialized object. 0 otherwise.
flush()
void flush()
Flush the audio record data pipeline.
read()
Read audio data from the source Read call will be blocking until all data has been dequeued for record and returns a full transaction byte count. If any internal error happens which results in partial data dequeue, then actual dequeued data will be returned. If any internal error happens before any data dequeue, an exception will be thrown.i32read(outu8[]buffer)
Parameters
buffer (out)
u8[] — Required
buffer to be used for copying audio data, size must be no smaller
than number returned by getMinBufferSizeInBytes.
Returns
i32
number of bytes copied to the buffer
Throws
InvalidArgumentError— if array size is smaller than AudioStreamRecord::getMinBufferSizeInBytes.
addAudioStreamEventListener()
Register listener for audio record eventscom.amazon.apmf.ISubscription*addAudioStreamEventListener(IAudioStreamEventListener*callback)
Parameters
callback
IAudioStreamEventListener* — Required
event listener
Returns
com.amazon.apmf.ISubscription*
ISubscription pointer to be used to unsubscribe to the listener

