2 using System.Collections.Generic;
5 using System.Threading.Tasks;
7 using Microsoft.Xna.Framework;
8 using System.Runtime.InteropServices;
9 using System.Threading;
16 private readonly
object mutex;
17 private Queue<short[]> sampleQueue;
27 sampleQueue =
new Queue<short[]>();
37 throw new NotImplementedException();
45 retVal = soundChannel !=
null && soundChannel.
IsPlaying;
54 sampleQueue.Enqueue(buf);
58 public override SoundChannel Play(
float gain,
float range, Vector2 position,
bool muffle =
false)
60 throw new InvalidOperationException();
63 public override SoundChannel Play(Vector3? position,
float gain,
float freqMult = 1.0f,
bool muffle =
false)
65 throw new InvalidOperationException();
73 if (soundChannel !=
null)
79 chn =
new SoundChannel(
this, gain,
null, 1.0f, 1.0f, 3.0f,
"video",
false);
100 while (readAmount<buffer.Length)
102 if (sampleQueue.Count == 0)
break;
103 buf = sampleQueue.Peek();
104 if (readAmount + buf.Length >= buffer.Length)
break;
105 buf = sampleQueue.Dequeue();
106 buf.CopyTo(buffer, readAmount);
107 readAmount += buf.Length;
override SoundChannel Play(float gain)
override int FillStreamBuffer(int samplePos, short[] buffer)
VideoSound(SoundManager owner, string filename, int sampleRate, int channelCount, Video vid)
override SoundChannel Play(float gain, float range, Vector2 position, bool muffle=false)
override SoundChannel Play(Vector3? position, float gain, float freqMult=1.0f, bool muffle=false)
void Enqueue(short[] buf)
override SoundChannel Play()
override bool IsPlaying()
override float GetAmplitudeAtPlaybackPos(int playbackPos)