startPlay abstract method
Start playing audio file.
Available since: 1.0.0
Description: Start playing the audio file. The SDK will read the audio file in the specified path and play it.
Use case: After the user receives the voice message, the API can be called to play the audio file that has been downloaded and saved locally.
When to call: After init.
Related APIs: When this API is called to start playback, the SDK will throw the onPlayerStarted notification. Only after receiving this callback notification can the developer consider that playback has officially started and update the UI display; after that, the SDK will call back the playback progress through onPlayerProgress; under abnormal circumstances, the SDK may also throw an onPlayerFailed notification, please Developers may monitor and alert users when exceptions occur as appropriate.
Caution: When the SDK starts playing, it will exclusively use the audio device, so it will interrupt the playback of other third-party apps and will not mix with the audio output of other apps.
Restrictions: Playback-related APIs cannot be used at the same time as recording-related APIs. At the same time, only recording or playback can be performed inside the SDK. Therefore, before you need to enable playback, developers must first ensure that the recording function is not being used at this time, otherwise playback will fail.
configPlay config
Implementation
Future<void> startPlay(ZIMAudioPlayConfig config);