Last active
May 26, 2023 11:22
-
-
Save vassjozsef/29e4d8d97afe53d3d94789a7bd709bf5 to your computer and use it in GitHub Desktop.
Create Audio Sending Stream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
webrtc::AudioSendStream* createAudioSendStream( | |
uint32_t ssrc, | |
uint8_t payloadType, | |
webrtc::Transport* transport, | |
rtc::scoped_refptr<webrtc::AudioEncoderFactory> audioEncoderFactory, | |
webrtc::Call* call) | |
{ | |
webrtc::AudioSendStream::Config config{transport}; | |
config.rtp.ssrc = ssrc; | |
config.rtp.extensions = {{"urn:ietf:params:rtp-hdrext:ssrc-audio-level", 1}}; | |
config.encoder_factory = audioEncoderFactory; | |
const webrtc::SdpAudioFormat kOpusFormat = {"opus", 48000, 2}; | |
config.send_codec_spec = | |
webrtc::AudioSendStream::Config::SendCodecSpec(payloadType, kOpusFormat); | |
webrtc::AudioSendStream* audioStream = call->CreateAudioSendStream(config); | |
audioStream->Start(); | |
return audioStream; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment