Sign in to follow this  

Wave files using DirectSound/DirectMusic

This topic is 3600 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

Hi Everyone, I am in the process of implementing playing sounds into me game engine. The requirements I have are: 1. must be wave files 2. must be able to play, pause, resume, stop 3. must be able to adjust the volume of each sound DirectSound 8 I wrote a library using IDirectSound8 and IDirectSoundBuffer. Using these I can play, pause, resume, and stop wave files. But I cannot adjust the volume. I tried using the SetVolume function in DirectSoundBuffer, but it does not work for me. DirectMusic8 I wrote a library using IDirectMusicLoader8, IDirectMusicPerformance8, IDirectMusicSegment8, IDirectMusicSegmentState8, IDirectMusicAudioPath8, IDirectSound3DBuffer8, and IDirectSound3DListener8. Using these I can play, stop, and lower the volume. But I cannot pause/resume a wave file. I understand that when the wave file is crated as a segment it only has one event so that is why it cannot resume. So, I need to create a sound library that accomplishes my three requirements. Does any one have any advise for me or another thing to try? Thanks Hamfiend

Share this post


Link to post
Share on other sites
Quote:
Original post by Hamfiend
DirectSound 8
I wrote a library using IDirectSound8 and IDirectSoundBuffer.
Using these I can play, pause, resume, and stop wave files.
But I cannot adjust the volume. I tried using the SetVolume function in DirectSoundBuffer, but it does not work for me.
Define "does not work". Does it crash? Does it not do anything? Does the function fail?

Did you create the buffer with the DSBCAPS_CTRLVOLUME flag?

Share this post


Link to post
Share on other sites
Hi Evil Steve,

Using the direct sound 8, it does not crash or fail. It just ignores the SetVolume call.

I do not create the sound buffer with the flag you indicated. I will do that now and let you know.

Thanks
Hamfiend

Share this post


Link to post
Share on other sites

This topic is 3600 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.

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