Live audio similar to Live video

Hiya,

I’m currently writing an application that uses the SDK to monitor live video only. The requirements have changed and now I need to monitor audio also. I’m currently using JPegLiveSource class to view the video, I’ve looked at using the LiveSourceContent class for the video and audio but there isn’t any mention of audio for that class in the SDK.

Which class is the best to use to monitor live audio and video?

Many thanks

Dave.

You can get the raw audio by using the RawLiveSource class

As a quick test I put the following code in the AudioDemo sample -

// _audioPlayerControl.Connect(); 
_rawLive = new RawLiveSource(_selectedMic); 
_rawLive.LiveContentEvent += _rawLive_LiveContentEvent; 
 
_rawLive.Init(); 
_rawLive.LiveModeStart = true; 
} 
} 
 
private void _rawLive_LiveContentEvent(object sender, EventArgs e) 
{ 
LiveContentRawEventArgs le = e as LiveContentRawEventArgs; 
byte[] by = le.LiveContent.Content; 
Debug.WriteLine("length " + by.Length); 
} 

As you can see I did not know how to interpret the audio data but I could see that it probably is the correct data..

Thankyou for your little example. Initially I think it will help with what I need to do. I’ll have a look into this in the next couple of days to see if it helps.

Thanks again.

Is the output of this the compressed audio as it comes from the camera? For example if the camera is set to g.711, this payload would be g.711?

Yes. The audio is not changed, it will be what the camera sends.