Jump to content
Sign in to follow this  
Guest AndrewW

DirectSound Volume

Recommended Posts

In the Initialization and Buffer Creation functions in the sound source file, you need to make sure the DSBCAPS_CTRLVOLUME flag is set.You need a line that will look something like:dsbd.dwFlags |= DSBCAPS_CTRLVOLUME | DSBCAPS_LOCSOFTWARE;Doug

Share this post


Link to post
Share on other sites
Guest AndrewW

Thanks Doug, it's working now :)Regards,Andrew

Share this post


Link to post
Share on other sites
Guest Ed Walters - PD

Sorry to drag up an Oooold thread, but I have exactly the same problem.I'll freely admit to being pretty inept at "C" programming, but I can make sounds loop, etc... but I just can't get the "ChangeVolume" command to work. I assume that the solution mentioned above is about adding the line to the Sound.cpp file? And my understanding is that if you're using makefile, nmake etc, to generate a "C" file as opposed to C++, that file isn't involved? Or have I got my wires crossed?Thanks in advance for any replies!

Share this post


Link to post
Share on other sites

Ed Walters - PD,Within the CreateStaticBuffer function in the Sound.cpp file, add the line in bold: ----------------------- // Set up the direct sound buffer, and only request the flags needed // since each requires some overhead and limits if the buffer can // be hardware accelerated DSBUFFERDESC dsbd; ZeroMemory( &dsbd, sizeof(DSBUFFERDESC) ); dsbd.dwSize = sizeof(DSBUFFERDESC); dsbd.dwFlags = DSBCAPS_STATIC; dsbd.dwBufferBytes = g_pWaveSoundRead[bufferN]->m_ckIn.cksize; dsbd.lpwfxFormat = g_pWaveSoundRead[bufferN]->m_pwfx; dsbd.dwFlags |= DSBCAPS_CTRLVOLUME | DSBCAPS_LOCSOFTWARE;-----------------------Hope this helps.


Andrew Wilson

sig_fslDeveloper.jpg

Share this post


Link to post
Share on other sites
Guest Ed Walters - PD

Thank you _very_ much, MachTwo! That solved the problem entirely - it now does exactly what I wanted.Ed

Share this post


Link to post
Share on other sites
Guest iholrf

And the link above takes you to a spamware site... not nice... drive by malware anybody?

Share this post


Link to post
Share on other sites

>And the link above takes you to a spamware site... not>nice... drive by malware anybody? Which link... I see two. LOL ;)


Ed Wilson

Mindstar Aviation
My Playland - I69

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...