VAPIX将音频发送到轴ip摄像头

时间:2012-06-24 09:26:54

标签: c# audio sdk speaker

我有一个带扬声器输出的轴凸轮。我在我的笔记本上安装了Vapix库,现在我可以收到MEPEG-4格式的视频。

现在我想将笔记本中捕获的音频发送到具有相同库的相机。

最后我搜索了这个文档,但我不知道如何在C#中使用它。

Vapix Audio SDK

1 个答案:

答案 0 :(得分:2)

问题的解决方案:

using System;
using System.Collections.Generic;
using System.ComponentModel; 
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VapixForToroRosso
{
public partial class Form1 : Form
{
    private string USER = "root";
    private string PASS = "Blescia";
    private string IP = "192.168.1.2";
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        axAxisMediaControl1.Volume = 100; //Set the volume of speaker
        /*
         *Use this if the camera required the login
         */
        axAxisMediaControl1.MediaUsername = USER; //Set the username
        axAxisMediaControl1.MediaPassword = PASS; //Set the password
        axAxisMediaControl1.Mute = false; //Disable Mute    
        axAxisMediaControl1.EnableReconnect = true; //Reconnect to the camera automatically

        axAxisMediaControl1.MediaURL = "rtsp://192.168.1.2/mpeg4/media.amp"; //For Retrieve the video streaming
        axAxisMediaControl1.AudioConfigURL = "http://" + IP + "/axis-cgi/view/param.cgi?camera=1&action=list&group=Audio,AudioSource.A0"; //Pre-Configuration of Camera
        axAxisMediaControl1.AudioTransmitURL = "http://" + IP + "/axis-cgi/audio/transmit.cgi"; //Url to send the streaming AUDIO          

        axAxisMediaControl1.Play();
    }

    private void btnStartStreaming_Click(object sender, EventArgs e)
    {
        axAxisMediaControl1.AudioTransmitStart(); //Start the streaming to camera
    }

    private void btnStopStreaming_Click(object sender, EventArgs e)
    {
        axAxisMediaControl1.AudioTransmitStop(); //Stop the streaming the camera
    }
   }
}