2022-08-02 21:04:12 +00:00
|
|
|
namespace MoonWorks.Audio
|
|
|
|
{
|
|
|
|
public abstract class StreamingSoundSeekable : StreamingSound
|
|
|
|
{
|
|
|
|
public bool Loop { get; set; }
|
|
|
|
|
2023-05-05 22:26:32 +00:00
|
|
|
protected StreamingSoundSeekable(
|
|
|
|
AudioDevice device,
|
|
|
|
ushort formatTag,
|
|
|
|
ushort bitsPerSample,
|
|
|
|
ushort blockAlign,
|
|
|
|
ushort channels,
|
|
|
|
uint samplesPerSecond,
|
|
|
|
uint bufferSize
|
|
|
|
) : base(
|
|
|
|
device,
|
|
|
|
formatTag,
|
|
|
|
bitsPerSample,
|
|
|
|
blockAlign,
|
|
|
|
channels,
|
|
|
|
samplesPerSecond,
|
|
|
|
bufferSize
|
|
|
|
) {
|
|
|
|
|
2022-08-02 21:04:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public abstract void Seek(uint sampleFrame);
|
|
|
|
|
|
|
|
protected override void OnReachedEnd()
|
|
|
|
{
|
|
|
|
if (Loop)
|
|
|
|
{
|
2023-03-07 23:28:57 +00:00
|
|
|
ConsumingBuffers = true;
|
2022-08-02 21:04:12 +00:00
|
|
|
Seek(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|