Custom audio device implementation based on mmdeviceapi. This custom audio device can be used instead of the default internal audio device provided by OpenTok.AudioDevice. More...
Inherits OpenTok.IAudioDevice, and IDisposable.
Public Member Functions | |
MMAudioDevice (IDispatcher dispatcher) | |
Creates a MMAudioDevice with enabled notifications that will be raised throw the provided IDispatcher. Subscribe to InputDeviceAdded, InputDeviceRemoved, DefaultInputDeviceChanged, OutputDeviceAdded, OutputDeviceRemoved, DefaultOutputDeviceChanged to take advantage of these notifications. More... | |
IList< AudioDevice.InputAudioDevice > | EnumerateInputAudioDevices () |
Returns a list of available audio input devices on the system. More... | |
IList< AudioDevice.OutputAudioDevice > | EnumerateOutputAudioDevices () |
Returns a list of available audio output devices on the system. More... | |
AudioDevice.InputAudioDevice | GetDefaultInputAudioDevice () |
Gets the system default audio input device. More... | |
AudioDevice.OutputAudioDevice | GetDefaultOutputAudioDevice () |
Gets the system default audio output device. More... | |
void | SetInputAudioDevice (string deviceId) |
Selects a device for audio input. This method also invokes AudioDevice.RestartInputAudioDevice() More... | |
void | SetOutputAudioDevice (string deviceId) |
Selects a device for audio output. This method also invokes AudioDevice.RestartOutputAudioDevice() More... | |
void | InitAudio (AudioDevice.AudioBus audioBus) |
Called when the AudioDevice is initialized. Use the AudioBus object to read write audio data. Call the AudioBus.ReadRenderData(IntPtr buffer, int numberOfSamples) and AudioBus.WriteCaptureData(IntPtr buffer, int numberOfSamples) methods to read render data from subscribers and write capture data to publishers. More... | |
void | DestroyAudio () |
Called when the IAudioDevice instance is destroyed. More... | |
void | InitAudioCapturer () |
Called when the audio capturer for the IAudioDevice instance is initialized. More... | |
void | DestroyAudioCapturer () |
Called when th audio capturer for the IAudioDevice instance is destroyed. More... | |
void | StartAudioCapturer () |
Called when the audio capturer starts. You should begin providing audio samples to the AudioBus.WriteCaptureData(IntPtr buffer, int numberOfSamples) method. More... | |
void | StopAudioCapturer () |
Called when the audio capturer stops. More... | |
bool | IsAudioCapturerInitialized () |
Checks if the audio capturer for the IAudioDevice instance is initialized. More... | |
bool | IsAudioCapturerStarted () |
Checks if the audio capturer for the IAudioDevice instance is started. More... | |
int | GetEstimatedAudioCaptureDelay () |
Gets the estimated audio capture delay. More... | |
AudioDeviceSettings | GetAudioCapturerSettings () |
Called when the IAudioDevice instance requires settings. In your implementation of this method, return an AudioDeviceSettings object. More... | |
void | InitAudioRenderer () |
Called when the audio renderer for the IAudioDevice instance is initialized. More... | |
void | DestroyAudioRenderer () |
Called when th audio renderer for the IAudioDevice instance is destroyed. More... | |
void | StartAudioRenderer () |
Called when the audio renderer starts. You should begin receiving audio samples from the AudioBus.ReadRenderData(IntPtr buffer, int numberOfSamples) method. More... | |
void | StopAudioRenderer () |
Called when the audio renderer stops. More... | |
bool | IsAudioRendererInitialized () |
Checks if the audio renderer for the IAudioDevice instance is initialized. More... | |
bool | IsAudioRendererStarted () |
Checks if the audio renderer for the IAudioDevice instance is started. More... | |
int | GetEstimatedAudioRenderDelay () |
Gets the estimated audio render delay. More... | |
AudioDeviceSettings | GetAudioRendererSettings () |
Gets settings for the audio renderer for the IAudioDevice instance. More... | |
void | Dispose () |
Protected Member Functions | |
virtual void | Dispose (bool disposing) |
Events | |
EventHandler< AudioDevice.Notifications.InputAudioDeviceEventArgs > | InputDeviceAdded |
Sent when a new audio input device is detected by the system. More... | |
EventHandler< AudioDevice.Notifications.OutputAudioDeviceEventArgs > | OutputDeviceAdded |
Sent when a new audio output device is detected by the system. More... | |
EventHandler< AudioDevice.Notifications.InputAudioDeviceEventArgs > | InputDeviceRemoved |
Sent when an audio input device is removed from the system. More... | |
EventHandler< AudioDevice.Notifications.OutputAudioDeviceEventArgs > | OutputDeviceRemoved |
Sent when an audio output device is removed from the system. More... | |
EventHandler< AudioDevice.Notifications.InputAudioDeviceEventArgs > | DefaultInputDeviceChanged |
Sent when the default audio input device changes at the system level. More... | |
EventHandler< AudioDevice.Notifications.OutputAudioDeviceEventArgs > | DefaultOutputDeviceChanged |
Sent when the default audio output device changes at the system level. More... |
Custom audio device implementation based on mmdeviceapi. This custom audio device can be used instead of the default internal audio device provided by OpenTok.AudioDevice.
To use this custom audio device:
Create an instance of this class.
Use the following MMAudioDevice methods instead of the static equivalents in AudioDevice:
Subscribe to the following MMAudioDevice events instead of default AudioDevice.Notifications events:
OpenTok.MMAudioDevice.MMAudioDevice | ( | IDispatcher | dispatcher | ) |
Creates a MMAudioDevice with enabled notifications that will be raised throw the provided IDispatcher. Subscribe to InputDeviceAdded, InputDeviceRemoved, DefaultInputDeviceChanged, OutputDeviceAdded, OutputDeviceRemoved, DefaultOutputDeviceChanged to take advantage of these notifications.
void OpenTok.MMAudioDevice.DestroyAudio | ( | ) |
Called when the IAudioDevice instance is destroyed.
Implements OpenTok.IAudioDevice.
void OpenTok.MMAudioDevice.DestroyAudioCapturer | ( | ) |
Called when th audio capturer for the IAudioDevice instance is destroyed.
Implements OpenTok.IAudioDevice.
void OpenTok.MMAudioDevice.DestroyAudioRenderer | ( | ) |
Called when th audio renderer for the IAudioDevice instance is destroyed.
Implements OpenTok.IAudioDevice.
IList<AudioDevice.InputAudioDevice> OpenTok.MMAudioDevice.EnumerateInputAudioDevices | ( | ) |
Returns a list of available audio input devices on the system.
IList<AudioDevice.OutputAudioDevice> OpenTok.MMAudioDevice.EnumerateOutputAudioDevices | ( | ) |
Returns a list of available audio output devices on the system.
AudioDeviceSettings OpenTok.MMAudioDevice.GetAudioCapturerSettings | ( | ) |
Called when the IAudioDevice instance requires settings. In your implementation of this method, return an AudioDeviceSettings object.
Implements OpenTok.IAudioDevice.
AudioDeviceSettings OpenTok.MMAudioDevice.GetAudioRendererSettings | ( | ) |
Gets settings for the audio renderer for the IAudioDevice instance.
Implements OpenTok.IAudioDevice.
AudioDevice.InputAudioDevice OpenTok.MMAudioDevice.GetDefaultInputAudioDevice | ( | ) |
Gets the system default audio input device.
AudioDevice.OutputAudioDevice OpenTok.MMAudioDevice.GetDefaultOutputAudioDevice | ( | ) |
Gets the system default audio output device.
int OpenTok.MMAudioDevice.GetEstimatedAudioCaptureDelay | ( | ) |
Gets the estimated audio capture delay.
Implements OpenTok.IAudioDevice.
int OpenTok.MMAudioDevice.GetEstimatedAudioRenderDelay | ( | ) |
Gets the estimated audio render delay.
Implements OpenTok.IAudioDevice.
void OpenTok.MMAudioDevice.InitAudio | ( | AudioDevice.AudioBus | audioBus | ) |
Called when the AudioDevice is initialized. Use the AudioBus object to read write audio data. Call the AudioBus.ReadRenderData(IntPtr buffer, int numberOfSamples) and AudioBus.WriteCaptureData(IntPtr buffer, int numberOfSamples) methods to read render data from subscribers and write capture data to publishers.
audioBus | The instance of the AudioBus to use for all publishers and subscribers. |
Implements OpenTok.IAudioDevice.
void OpenTok.MMAudioDevice.InitAudioCapturer | ( | ) |
Called when the audio capturer for the IAudioDevice instance is initialized.
Implements OpenTok.IAudioDevice.
void OpenTok.MMAudioDevice.InitAudioRenderer | ( | ) |
Called when the audio renderer for the IAudioDevice instance is initialized.
Implements OpenTok.IAudioDevice.
bool OpenTok.MMAudioDevice.IsAudioCapturerInitialized | ( | ) |
Checks if the audio capturer for the IAudioDevice instance is initialized.
Implements OpenTok.IAudioDevice.
bool OpenTok.MMAudioDevice.IsAudioCapturerStarted | ( | ) |
Checks if the audio capturer for the IAudioDevice instance is started.
Implements OpenTok.IAudioDevice.
bool OpenTok.MMAudioDevice.IsAudioRendererInitialized | ( | ) |
Checks if the audio renderer for the IAudioDevice instance is initialized.
Implements OpenTok.IAudioDevice.
bool OpenTok.MMAudioDevice.IsAudioRendererStarted | ( | ) |
Checks if the audio renderer for the IAudioDevice instance is started.
Implements OpenTok.IAudioDevice.
void OpenTok.MMAudioDevice.SetInputAudioDevice | ( | string | deviceId | ) |
Selects a device for audio input. This method also invokes AudioDevice.RestartInputAudioDevice()
deviceId | Id of the device |
void OpenTok.MMAudioDevice.SetOutputAudioDevice | ( | string | deviceId | ) |
Selects a device for audio output. This method also invokes AudioDevice.RestartOutputAudioDevice()
deviceId | Id of the device |
void OpenTok.MMAudioDevice.StartAudioCapturer | ( | ) |
Called when the audio capturer starts. You should begin providing audio samples to the AudioBus.WriteCaptureData(IntPtr buffer, int numberOfSamples) method.
Implements OpenTok.IAudioDevice.
void OpenTok.MMAudioDevice.StartAudioRenderer | ( | ) |
Called when the audio renderer starts. You should begin receiving audio samples from the AudioBus.ReadRenderData(IntPtr buffer, int numberOfSamples) method.
Implements OpenTok.IAudioDevice.
void OpenTok.MMAudioDevice.StopAudioCapturer | ( | ) |
Called when the audio capturer stops.
Implements OpenTok.IAudioDevice.
void OpenTok.MMAudioDevice.StopAudioRenderer | ( | ) |
Called when the audio renderer stops.
Implements OpenTok.IAudioDevice.
EventHandler<AudioDevice.Notifications.InputAudioDeviceEventArgs> OpenTok.MMAudioDevice.DefaultInputDeviceChanged |
Sent when the default audio input device changes at the system level.
EventHandler<AudioDevice.Notifications.OutputAudioDeviceEventArgs> OpenTok.MMAudioDevice.DefaultOutputDeviceChanged |
Sent when the default audio output device changes at the system level.
EventHandler<AudioDevice.Notifications.InputAudioDeviceEventArgs> OpenTok.MMAudioDevice.InputDeviceAdded |
Sent when a new audio input device is detected by the system.
EventHandler<AudioDevice.Notifications.InputAudioDeviceEventArgs> OpenTok.MMAudioDevice.InputDeviceRemoved |
Sent when an audio input device is removed from the system.
EventHandler<AudioDevice.Notifications.OutputAudioDeviceEventArgs> OpenTok.MMAudioDevice.OutputDeviceAdded |
Sent when a new audio output device is detected by the system.
EventHandler<AudioDevice.Notifications.OutputAudioDeviceEventArgs> OpenTok.MMAudioDevice.OutputDeviceRemoved |
Sent when an audio output device is removed from the system.