DirectMusic and sound quality

Started by
2 comments, last by Rudan 21 years ago
I have a problem with DirectMusic. When I want to play a segment I use this: performance->PlaySegment(segment, DMUS_SEGF_SECONDARY, 0, NULL); It works, but the problem is that it sounds horrible. The sound quality isn''t even close to the original wave file. However, if I play it without the DMUS_SEGF_SECONDARY flag, it sounds fine. But then, of course, I can only play one sound at a time. Any ideas?
-----------------------------Reporter: Are they slow-moving, chief?Sheriff: Yeah, they're dead. They're all messed up.-Night of the living dead
Advertisement
Use DirectSound to play more than a sound at a time, Use DirectMusic for background music

If God with me, Who against me?
--------------------------------------------- If God with me, Who against me?Personal Web Samuel Prince Blog...
yes, I had this exact same problem once.

I think you are actually playing the file many times over at teh same instant!

I.e. you called performance->PlaySegment(...) repeatedly for a split second when you pressed a key to actually start playing the wave..

Ie.

while(true) {
if(kbhit()) performance->PlaySegment(...);
};

this code will play the performance many times all dubbed on itself (ruining the sound quality) when you only want to play it once!! Only if you press the keyboard very quickly will you get it to play just once..

www.cppnow.com
superdeveloper: You''re right. I should have thought about that myself. Thanks!
-----------------------------Reporter: Are they slow-moving, chief?Sheriff: Yeah, they're dead. They're all messed up.-Night of the living dead

This topic is closed to new replies.

Advertisement