public class FX
{
private List<Buffer> AudioFiles = new List<Buffer>();
private Device dev;
public FX()
{
dev = new Device();
dev.SetCooperativeLevel(new Control(), CooperativeLevel.Priority);
}
public void openSound(string address)
{
AudioFiles.Add(new Buffer(address, dev));
}
}
When the new buffer is made it throws an exception.
Oh and if you were wondering address = "C:\B.mp3".
Oh and for those of you who noticed it I made a mistake in the title it should be DirectX.DirectSound.Buffer
[Edited by - DarkDrag0n on September 20, 2004 12:44:12 AM]
[.net] DirectX.Buffer error
Im having a problem with my audio using C# and Managed DirectX in the device. I know I have the address right.
im getting a:
ArgumentException was unhandled
value does not fall within the expected range
exception
I have narrowed the code down to this, here's the code
I don't know if this is what is causing your problem and I could be totaly wrong about this, but I don't believe that DirectSound will just play mp3 files. You will probably have to get some knid of decoder and decode them into wave data before you can drop them into the sound card.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement