• Advertisement
Sign in to follow this  

[.net] DirectX.Buffer error

This topic is 4895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement