Ejemplo n.º 1
0
 public void Play()
 {
     RequestBuffers();
     _finished = false;
     if (_seekTime != null)
     {
         _startTime = (int)(_context.currentTime * 1000 - _seekTime.Value);
         _seekTime = null;
         _pauseTime = 0;
         _paused = false;
     }
     else if (_paused)
     {
         _paused = false;
         _pauseTime += (int)(_context.currentTime * 1000 - _pauseStart);
     }
     else
     {
         _startTime = (int)(_context.currentTime * 1000);
         _pauseTime = 0;
     }
     _source = _context.createBufferSource();
     _source.buffer = _buffer;
     _source.loop = true;
     _source.connect(_audioNode, 0, 0);
     _source.start(0);
     _audioNode.connect(_context.destination, 0, 0);
 }
 public void Play()
 {
     RequestBuffers();
     _finished = false;
     _source = _context.createBufferSource();
     _source.buffer = _buffer;
     _source.loop = true;
     _source.connect(_audioNode, 0, 0);
     _source.start(0);
     _audioNode.connect(_context.destination, 0, 0);
 }