• April 27, 2024, 08:24:02 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: ACAS Audio Format Streaming  (Read 2778 times)

marco.moscatelli

  • Level 1 Member
  • *
  • Posts: 1
ACAS Audio Format Streaming
« on: October 11, 2016, 03:15:20 AM »

Hi folks,
i have a DCS-5222L  camera and am developing software in C# to control it.
I'm using httpwebrequest to catch pan, tilt and zoom.
I also implemented through the recording of the camera and save the file system in avi format.
My problem comes when I have to save the audio: I saw that among the cgi there is a command to save the stream:
Code: [Select]
var command = "http: //" + ip + "/audio/ACAS.cgi?profileid=1";
The method is the following:
Code: [Select]
try
            {
                var total = 0;
                _stream = new MemoryStream();

                var ip = Resources.IPCAM;
                var command = "http://" + ip + "/audio/ACAS.cgi?profileid=1";

                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(command);
                request.Credentials = new NetworkCredential(Resources.CAM_USER, Resources.CAM_PASSWORD);
                WebResponse response = request.GetResponse();

                Stream s = response.GetResponseStream();

                var audioFile = @"C:\picture\" + "WAV" + DateTime.Now.ToString("ddMMyyyy_hhmmss.fff") + ".wav";
                using (fs = File.Create(audioFile))
                {
                    byte[] buffer = new byte[4096];
                    while (s.CanRead)
                    {
                        Array.Clear(buffer, 0, buffer.Length);
                        total += s.Read(buffer, 0, buffer.Length);
                        fs.Write(buffer, 0, buffer.Length);

                        _stream.WriteTo(fs);
                        //fs.Close();
                        //_stream.Close();
                    }
                }

                //response.Close();

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
I can't read the new wav file...it is generated but does not open...
have you ever tried to save streaming audio in a file?

kindly let me know.
Thank you and good day.

MM
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting
Re: ACAS Audio Format Streaming
« Reply #1 on: October 11, 2016, 07:39:53 AM »

I haven't. Not sure if anyone else has. Not much activity mentioning this.

Users have embeded audio though:
http://forums.dlink.com/index.php?topic=65724.msg274430#msg274430
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.