Code sample - Select audio output

Delphi and C# (ActiveX) sample code.

Get list of available audio output devices

for I := 0 to VideoCapture1.Audio_OutputDevices_GetCount - 1 do
  cbAudioOutputDevice.Items.Add(VideoCapture1.Audio_OutputDevices_GetItem(i));
for (int i = 0; i < VideoCapture1.Audio_OutputDevices_GetCount(); i++)
  cbAudioOutputDevice.Items.Add(VideoCapture1.Audio_OutputDevices_GetItem(i));

Select device

VideoCapture1.Audio_OutputDevice := cbAudioOutputDevice.Items[cbAudioOutputDevice.ItemIndex];
VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text;

Enable audio output 

VideoCapture1.Audio_PlayAudio := true;
VideoCapture1.Audio_PlayAudio = true;

Set volume level 

VideoCapture1.Audio_OutputDevice_SetVolume(tbAudioVolume.Position);
VideoCapture1.Audio_OutputDevice_SetVolume((uint)tbAudioVolume.Value);

Set balance level 

VideoCapture1.Audio_OutputDevice_SetBalance(tbAudioBalance.Position);
VideoCapture1.Audio_OutputDevice_SetBalance(tbAudioBalance.Value);

VisioForge © 2006-2019

  • GitHub-Mark-64px
  • Twitter Социальные Иконка
  • VisioForge Facebook page
  • YouTube channel