Talk:DirectX:DirectSound:Tutorials:VBNET:DX9:Playing Sounds

From GPWiki

Files:GUITutorial_warn.gif The Game Programming Wiki has moved! Files:GUITutorial_warn.gif

The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server.

However, the GPWiki forums are still active! Come say hello.

This gives errors when I try this. Specifically I get problems with creation of the secondary buffer. I get an exception "Value does not fall within the expected range." on the line:

           _buffer = New SecondaryBuffer(ofd.FileName, _dev)

Sadly the message is not specific as to which value it does not like. I had widened the search dialogue to include mp3 and mdw files and have similar results. Though this is certainly true of the code which is available for download.

I have looked at various news groups and found others with this same problem using DX9 but no solutions. I have downloaded the sample application posted and this displays the same error.

Any thoughts?

Stephen Connell.

I tried some experiments on my computer, and I noticed it gave the error when playing an mp3 file, but not when playing a wave file. You should only be using DirectSound for sound effects, not music. For music, use DirectAudioVideoPlayback. I wrote a tutorial on playing music for the wiki, which may help.
--Lachlan87 09:12, 8 Apr 2005 (EDT)