我必须设计一个具有声响的方案(来自WAV档案)。 我必须打.。 一旦完成,我就不得不改变该波卷宗的内容,并再次投入使用。 它就像一个不断变化的波浪。 我的想法是形成一个溪流,但问题在于何时才开始(使用ms)。 邮电和石头,WriteByte是一种错误,说“波头号是腐败的”。 我的法典如下:
MemoryStream ms = new MemoryStream(Sample1);
SoundPlayer myPlayer = new SoundPlayer(ms);
myPlayer.Play(); //Wav file plays
for (int x = 0; x < 50; x++)
{
ms.Position = 44 + x;
ms.WriteByte(10);
}
myPlayer.Stop();
myPlayer.Play(); //Header file corrupt
Is there maybe another way I can loop a stream, and change its contents while it is playing. For example, the stream is looping Sound1 and whenever a button is pressed, the stream s content is changed to play Sound2.
Thank you!