I'm trying to capture an audio stream from Axis IP camera. The audio data encoded as g.711 should be captured from the camera. I'm using the following http request:
Stream roughStream = null; string URLaudio = "http://126.96.36.199/axis-cgi/audio/receive.cgi?httptype=singlepart"; request = (HttpWebRequest)HttpWebRequest.Create(URLaudio); request.Credentials = new NetworkCredential("admin", "password"); request.Method = "GET"; audioResponse = (HttpWebResponse)request.GetResponse(); roughStream = audioResponse.GetResponseStream();
However, I am getting that audioResponse has ContentLength equal to -1, (meaning that either I'm not getting the data at all, or it cannot read the stream beacuse of something (stream too long?!?).
I am guessing that camera is sending a continuous stream of packets (at least this is what is said in Axis manual). However, I don't know how to capture and read (I mean decode and play) data stream from the camera.
Is there a way to read stream of g.711 encoded audio with some built in Windows api?
Any suggestions how to do this?