Jump to content
  • Advertisement
Sign in to follow this  
bkadoum2

Tonality problem when switching song

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

I want remove the last annoying bug in my game! The problem: At a some point of time when a song switch to another, the sound heared is different then original: Sometimes some instruments disapear, sometimes tonality is different... and I have to turn off speaker! The game is playing sound and music together and uses wav files for sound and midi files for music (I just downloaded them on Internet). When game is initialized, everything is loaded in the same Performance and then it starts a song. When a song finish it switches to another song, and so on Indefinitely. I made a very basic DirectMusic. I just encapsulated DM objects in my own classes. Look like this: class Sound : public Object { private: bool playing; IDirectMusicSegment8 *Segment; IDirectMusicSegmentState *SegmentState; MUSIC_TIME length, now; IDirectMusicAudioPath8 *AudioPath; public: // some methods to play/stop a sound }; class SoundPlayer { private: IDirectMusicLoader8 *Loader; IDirectMusicPerformance8 *Performance; IDirectMusicAudioPath8 *AudioPath; public: // some methods to initialize/destroy }; Here is my method to play a sound void Sound::Play(DWORD repeats, DWORD flag) { playing = true; Segment->SetRepeats(repeats); if (AudioPath) { // Band is an external instance of SoundPlayer Band->GetPerformance()->PlaySegmentEx(Segment, NULL, NULL, flag, 0, &SegmentState, NULL, AudioPath); } else Band->GetPerformance()->PlaySegment(Segment, flag, 0, &SegmentState); } any idea?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!