abcfantasy
Programmer
Hi, I've got a problem when creating a new DirectSound.Buffer object.
Wave files are saved as streams in a resources file and the following works perfectly:
However, midi files are saved as an array of bytes. I try to copy that array in a stream, and then create the buffer but am getting an ArgumentException (Value does not fall within the expected range).
What am I doing wrong?
Any help is greatly appreciated
Thanks
Andrew
ABC -
Wave files are saved as streams in a resources file and the following works perfectly:
Code:
soundBuffer = new Microsoft.DirectX.DirectSound.Buffer( Resources.wav1, device );
However, midi files are saved as an array of bytes. I try to copy that array in a stream, and then create the buffer but am getting an ArgumentException (Value does not fall within the expected range).
Code:
MemoryStream stream = new MemoryStream( Resources.midi1 );
soundBuffer = new Microsoft.DirectX.DirectSound.Buffer( stream, device );
What am I doing wrong?
Any help is greatly appreciated
Thanks
Andrew
ABC -