Example #1
0
        public AudioStream(BusAttachment bus, string name, MP3Reader mp3Reader, UInt32 jitter, UInt32 prefill)
        {
            _mediaStream = new MediaStream(bus, name, mp3Reader.GetDescription());
            _mediaPacer  = new MediaPacer(mp3Reader.GetDescription(), jitter, 0);
            _mp3Reader   = mp3Reader;
            _prefill     = prefill;

            _mediaStream.OnOpen         += OnOpen;
            _mediaStream.OnClose        += OnClose;
            _mediaStream.OnPlay         += OnPlay;
            _mediaStream.OnPause        += OnPause;
            _mediaStream.OnSeekRelative += OnSeekRelative;
            _mediaStream.OnSeekAbsolute += OnSeekAbsolute;

            _mediaPacer.JitterMiss    += JitterMiss;
            _mediaPacer.RequestFrames += RequestFrames;
            _buffer = new byte[_frameReadLength * _mp3Reader.FrameLen];
        }
Example #2
0
        public AudioStream(BusAttachment bus, string name, MP3Reader mp3Reader, UInt32 jitter, UInt32 prefill)
        {
            _mediaStream = new MediaStream(bus, name, mp3Reader.GetDescription());
            _mediaPacer = new MediaPacer(mp3Reader.GetDescription(), jitter, 0);
            _mp3Reader = mp3Reader;
            _prefill = prefill;

            _mediaStream.OnOpen += OnOpen;
            _mediaStream.OnClose += OnClose;
            _mediaStream.OnPlay += OnPlay;
            _mediaStream.OnPause += OnPause;
            _mediaStream.OnSeekRelative += OnSeekRelative;
            _mediaStream.OnSeekAbsolute += OnSeekAbsolute;

            _mediaPacer.JitterMiss += JitterMiss;
            _mediaPacer.RequestFrames += RequestFrames;
            _buffer = new byte[_frameReadLength * _mp3Reader.FrameLen];

        }