DirectMusic and sound quality
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?
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?
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement