createCustomAudioTrack abstract method
- required AudioTrackType trackType,
- required AudioTrackConfig config,
Creates a custom audio track.
To publish custom captured audio in a channel, follow these steps: Call this method to create an audio track and get the audio track ID. When calling joinChannel to join a channel, set publishCustomAudioTrackId in ChannelMediaOptions to the audio track ID you want to publish, and set publishCustomAudioTrack to true. Call pushAudioFrame and set trackId to the audio track ID specified in step 2 to publish the corresponding custom audio source in the channel. This method must be called before joining a channel.
trackTypeCustom audio track type. See AudioTrackType. If audioTrackDirect is specified, you must set publishMicrophoneTrack to false in ChannelMediaOptions when calling joinChannel; otherwise, joining the channel will fail and return error code -2.configCustom audio track configuration. See AudioTrackConfig.
Returns If the method call succeeds, it returns the audio track ID as the unique identifier of the audio track. If the method call fails, it returns 0xffffffff. See Error Codes for details and resolution suggestions.
Implementation
Future<int> createCustomAudioTrack(
{required AudioTrackType trackType, required AudioTrackConfig config});