SetAudioSource (DVR version only)
Top  Previous  Next

Description

Sets the index of the audio recording device to be used during the AVI capture.


Syntax


[VB]
objActiveDcam.SetAudioSource Index


[C/C++]
HRESULT SetAudioSource(short Index);


Data Types
[VB]

Source: Integer


Parameters
[C/C++]

Index [in]  
Zero-based index of the selected audio source in the system list of audio recording devices. If -1 (default), no audio track will be recorded.  


Return Values


S_OK  
Success  
E_FAIL  
Failure to set the audio source  
 

Example


This VB example initializes a combo box with the descriptions of available audio recording devices and uses it to select a specific device:

AudioLst = ActiveDcam1.GetAudioList  
For i = 0 To UBound(AudioLst)  
Combo1.AddItem (AudioLst(i))  
Next  
Combo1.ListIndex = 0  
ActiveDcam1.SetAudioSource 0  
 
Private Sub Combo1_Click()  
ActiveDcam1.SetAudioSource Combo1.ListIndex  
End Sub  
 
Private Sub Capture_Click  
ActiveDcam1.StartCapture "c:\\capture_with_sound.avi"  
End Sub  


Remarks

This method allows you to add the audio track to your AVI file and select a specific audio recording device. If only one recording device (such as a microphone) is present in the system, use 0 as the value of Index. To disable the audio recording, call SetAudioSource with the value of Index -1. Note that by default the audio recording is disabled in ActiveDcam.

To initiate the AVI recording, use StartCapture.