Sign in to follow this  
DarkDrag0n

[.net] DirectX.Buffer error

Recommended Posts

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
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this