Archived

This topic is now archived and is closed to further replies.

How to be able to set volume of current sound?

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

Ive got my directsound8 wrapper... and im trying to add a volume control for my play function eg play(long volume){}; But when i change the value between 0 to -10000 nothing happens to the sound. Ive got the directsound class that initialises with primary buffer etc, with this code
DSBUFFERDESC dsbd;
ZeroMemory( &dsbd, sizeof(DSBUFFERDESC) );
dsbd.dwSize        = sizeof(DSBUFFERDESC);
dsbd.dwFlags       = DSBCAPS_CTRLVOLUME|DSBCAPS_PRIMARYBUFFER;
dsbd.dwBufferBytes = 0;
dsbd.lpwfxFormat   = NULL;
m_pDS->CreateSoundBuffer( &dsbd, &pDSBPrimary, NULL ) ;
and ive got my wave class which loads and plays sound,---heres the code im trying to set volume
m_apDSBuffer->SetVolume( -10000);
nothing happens tho What to do ?

Share this post


Link to post
Share on other sites