This topic describes the methods of the IAudioFrameObserver class provided by Real-Time Communication (RTC) SDK for Windows.
List of methods
| Method | Description | Supported earliest version |
| OnRawDataAudioFrame | The callback that is invoked when local audio data is collected. | V2.1 |
| OnPublishAudioFrame | The callback that is invoked when a user initiates stream ingest for a local audio track. | V2.1 |
| OnSubscribeAudioFrame | The callback that is invoked when a user subscribes to the data of an audio track. | V2.1 |
| OnPlaybackAudioFrameBeforeMixing | The callback that is invoked to return the audio data of the specified user before the audio is mixed. | V2.1 |
Details of methods
- OnRawDataAudioFrame: the callback that is invoked when local audio data is collected. If a value of true is returned, the audio data is returned to the SDK. If a value of false is returned, the audio data is not returned to the SDK.
bool OnRawDataAudioFrame(AliEngineAudioRawData audioRawData);Parameter Type Description audioRawData AliEngineAudioRawData The raw audio data. - OnPublishAudioFrame: the callback that is invoked when a user initiates stream ingest for a local audio track. If a value of true is returned, the audio data is returned to the SDK. If a value of false is returned, the audio data is not returned to the SDK.
bool OnPublishAudioFrame(AliEngineAudioRawData audioRawData);Parameter Type Description audioRawData AliEngineAudioRawData The raw audio data. - OnSubscribeAudioFrame: the callback that is invoked when a user subscribes to the data of an audio track. If a value of true is returned, the audio data is returned to the SDK. If a value of false is returned, the audio data is not returned to the SDK.
bool OnSubscribeAudioFrame(AliEngineAudioRawData audioRawData);Parameter Type Description audioRawData AliEngineAudioRawData The raw audio data. - onPlaybackAudioFrameBeforeMixing: the callback that is invoked to return the audio data of the specified user before the audio is mixed. If a value of true is returned, the audio data is returned to the SDK. If a value of false is returned, the audio data is not returned to the SDK.
bool OnPlaybackAudioFrameBeforeMixing(const char *uid, AliEngineAudioRawData audioRawData);Parameter Type Description uid const char * The ID of the user. audioRawData AliEngineAudioRawData The raw audio data.
该文章对您有帮助吗?