Ejemplo n.º 1
0
 public override void OnOutputConnected(string srcSlotName, NodeBase target, string targetSlotName)
 {
     base.OnOutputConnected(srcSlotName, target, targetSlotName);
     if (srcSlotName == "Grabber" && _grabber != null)
     {
         _grabber.Restart();
         _grabber.Start();
         _grabber.SetVolume(_volume);
     }
     else if (srcSlotName == "Samples" && _grabber != null)
     {
         _grabber.Start();
         _grabber.StartThreadedGrabber();
     }
 }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        _grabber  = new GstUnityAudioGrabber();
        _grabber2 = new GstCustomAudioGrabber();

        _grabber2.Init("filesrc location=\"" + AudioFile + "\" ! decodebin3 ! audioconvert ! audioresample", Channels, SampleRate);

        _osc = new Oscillator();
        _osc.SetNote(70);
        _grabber.Init(_osc.SamplesCount() * 10, 1, AudioSettings.outputSampleRate);

        float[] data = new float[_grabber.BufferLength];
        for (int i = 0; i < data.Length; ++i)
        {
            data [i] = _osc.Sample();
        }
        _data = data;

        _streamer = new GstAppNetAudioStreamer();
        _streamer.AttachGrabber(_grabber2);

        _grabber2.Start();

        _streamer.SetIP("127.0.0.1", 5001);
        _streamer.CreateStream();
        _streamer.Stream();
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     _grabber = new GstCustomAudioGrabber();
     _grabber.Init("filesrc location=\"" + AudioFile + "\" ! decodebin3 ! audioconvert ! audioresample", Channels, SamplingRate);
     _grabber.Start();
     _grabber.OnDataArrived += OnDataArrived;
 }