File tree Expand file tree Collapse file tree
APIExample-Audio/APIExample-Audio/Examples/Advanced/CustomAudioRender
APIExample/APIExample/Examples/Advanced/CustomAudioRender Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ class CustomAudioRenderMain: BaseViewController {
7171 // Set audio route to speaker
7272 agoraKit. setDefaultAudioRouteToSpeakerphone ( true )
7373
74+ // It is necessary to use publishMicrophoneTrack(true) and pullPlaybackAudio should utilize gameStreaming.
75+ agoraKit. setAudioScenario ( . gameStreaming)
76+
7477 // important!! this example is using onPlaybackAudioFrame to do custom rendering
7578 // by default the audio output will still be processed by SDK hence below api call is mandatory to disable that behavior
7679// agoraKit.adjustPlaybackSignalVolume(0)
@@ -88,7 +91,7 @@ class CustomAudioRenderMain: BaseViewController {
8891 // the token has to match the ones used for channel join
8992 let option = AgoraRtcChannelMediaOptions ( )
9093 option. publishCameraTrack = false
91- option. publishMicrophoneTrack = false
94+ option. publishMicrophoneTrack = true
9295 option. autoSubscribeAudio = true
9396 option. autoSubscribeVideo = false
9497 option. channelProfile = . liveBroadcasting
Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ class CustomAudioRenderMain: BaseViewController {
7171 agoraKit. enableAudio ( )
7272 // Set audio route to speaker
7373 agoraKit. setDefaultAudioRouteToSpeakerphone ( true )
74+ // It is necessary to use publishMicrophoneTrack(true) and pullPlaybackAudio should utilize gameStreaming.
75+ agoraKit. setAudioScenario ( . gameStreaming)
7476
7577 // start joining channel
7678 // 1. Users can only see each other after they join the
@@ -80,7 +82,7 @@ class CustomAudioRenderMain: BaseViewController {
8082 // the token has to match the ones used for channel join
8183 let option = AgoraRtcChannelMediaOptions ( )
8284 option. publishCameraTrack = false
83- option. publishMicrophoneTrack = false
85+ option. publishMicrophoneTrack = true
8486 option. autoSubscribeAudio = true
8587 option. autoSubscribeVideo = false
8688 option. channelProfile = . liveBroadcasting
You can’t perform that action at this time.
0 commit comments