Represents an audio source that can be added to a WebRTC call.
More...
#include <AudioSource.h>
Represents an audio source that can be added to a WebRTC call.
Pass a shared_ptr to an instance of this to the StreamClient and call sendFrame for each of your audio frame.
◆ AudioSource()
AudioSource::AudioSource |
( |
AudioSourceConfiguration |
configuration, |
|
|
int |
bitsPerSample, |
|
|
int |
sampleRate, |
|
|
size_t |
numberOfChannels |
|
) |
| |
Creates an AudioSource.
- Parameters
-
configuration | the configuration applied to the audio stream by the audio transport layer |
bitsPerSample | The audio stream sample size (8, 16 or 32 bits) |
sampleRate | The audio stream sample rate |
numberOfChannels | The audio stream channel count |
◆ AddSink()
void AudioSource::AddSink |
( |
webrtc::AudioTrackSinkInterface * |
sink | ) |
|
|
override |
◆ bytesPerFrame()
size_t AudioSource::bytesPerFrame |
( |
| ) |
const |
◆ bytesPerSample()
size_t AudioSource::bytesPerSample |
( |
| ) |
const |
◆ configuration()
- Returns
- The audio source configuration
◆ options()
const cricket::AudioOptions AudioSource::options |
( |
| ) |
const |
|
override |
- Returns
- The audio source options
◆ remote()
bool AudioSource::remote |
( |
| ) |
const |
|
override |
Indicates if this source is remote.
- Returns
- Always false, the source is local
◆ RemoveSink()
void AudioSource::RemoveSink |
( |
webrtc::AudioTrackSinkInterface * |
sink | ) |
|
|
override |
◆ sendFrame() [1/2]
void opentera::AudioSource::sendFrame |
( |
const void * |
audioData, |
|
|
size_t |
numberOfFrames |
|
) |
| |
|
inline |
Send an audio frame
- Parameters
-
audioData | The audio data |
numberOfFrames | The number of frames |
◆ sendFrame() [2/2]
void AudioSource::sendFrame |
( |
const void * |
audioData, |
|
|
size_t |
numberOfFrames, |
|
|
bool |
isTyping |
|
) |
| |
Send an audio frame
- Parameters
-
audioData | The audio data |
numberOfFrames | The number of frames |
isTyping | Indicates if the frame contains typing sound. This is only useful with the typing detection option. |
◆ setAudioDeviceModule()
Internal use only.
- Parameters
-
◆ state()
webrtc::MediaSourceInterface::SourceState AudioSource::state |
( |
| ) |
const |
|
override |
Indicates if this source is live.
- Returns
- Always kLive, the source is live
The documentation for this class was generated from the following files: