Reference of IAudioManager
Description of IAudioManager. It is to support an external audio device. One of examples is Watch.
Methods
isInitialized
int isInitialized() |
Return | 1: initialized, 0< uninitialized |
Description | Check initialization |
Android SDK | 2.1.1 |
iOS SDK | 2.1.1 |
Windows SDK | 2.1.1 |
Linux SDK | 3.0.1 |
setEventHandler
int setEventHandler(IAudioManagerEvent event) |
event | IAudioManagerEvent callback |
Return | 0:Success, 0<ErrorCode |
Description | set IAudioManager event callback |
Android SDK | 2.1.1 |
iOS SDK | 2.1.1 |
Windows SDK | 2.1.1 |
Linux SDK | 3.0.1 |
getType
int getType() |
Return | 0 : capturer, 1 : player, 2 : capturer+player iOS and Android can support only capturer. Windows don't support all |
Expected Events | |
Description | get audio manager's type |
Android SDK | 2.1.1 |
iOS SDK | 2.1.1 |
Windows SDK | 2.1.1 |
Linux SDK | 3.0.1 |
int configure(int Samplerate, int ChannelCount, int BitPerSample) |
Samplerate | Samplerate, 16000/48000 |
ChannelCount | ChannelCount, 1 |
BitPerSample | BitPerSample, 16 |
Return | 0:Success, 0<ErrorCode |
Expected Events | |
Description | Configure audio device for Catpure. |
Android SDK | 2.1.1 |
iOS SDK | 2.1.1 |
Windows SDK | 2.1.1 |
Linux SDK | 3.0.1 |
start
int start() |
Return | 0:Success, 0<ErrorCode |
Expected Events | |
Description | Start stream |
Android SDK | 2.1.1 |
iOS SDK | 2.1.1 |
Windows SDK | 2.1.1 |
Linux SDK | 3.0.1 |
write
int write(byte[] DataBuffer, int DataLength, unsigned int TimeStamp) |
DataBuffer | Received data |
DataLength | Received data length |
TimeStamp | Stream time |
Return | 0:Success, 0<ErrorCode |
Expected Events | |
Description | Write audio to device. |
Android SDK | 2.1.1 |
iOS SDK | 2.1.1 |
Windows SDK | 2.1.1 |
Linux SDK | 3.0.1 |
stop
int stop() |
Return | 0:Success, 0<ErrorCode |
Expected Events | |
Description | Stop stream |
Android SDK | 2.1.1 |
iOS SDK | 2.1.1 |
Windows SDK | 2.1.1 |
Linux SDK | 3.0.1 |
Events
onError
void onError(IAudioManager manager, int ErrorCode) |
manager | AudioManager instance |
ErrorCode | Error code |
Description | Errer event |
Android SDK | 2.1.1 |
iOS SDK | 2.1.1 |
Windows SDK | 2.1.1 |
Linux SDK | 3.0.1 |
onRead
void onRead(IAudioManager manager, byte[] DataBuffer, int DataLength, unsigned int TimeStamp) |
manager | AudioManager instance |
DataBuffer | Read data |
DataLength | Read data length, 20 ms, (If Samplerate is 48000Hz, 1920 bytes, If Samplerate is 16000Hz, 640 bytes) |
TimeStamp | Stream time |
Description | Read audio from device. |
Android SDK | 2.1.1 |
iOS SDK | 2.1.1 |
Windows SDK | 2.1.1 |
Linux SDK | 3.0.1 |