i have like 6 different instrument with different note to be played. Should i initiate the phonon at the main menu before we chose the instrument? But there will be about 30-40 mediaobject created and only 6-10 used at one time.
In my program, before we go to one instrument, i initialize phonon and each time i push the sound button to play a note, i only use play. But it still has the delay problem. Here an example of my project
void drumplayer::phonon_initiation(){
snare = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource("snare.wav"));
bass = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource("bass.wav"));
}
void drumplayer::playsnare(){
snare->stop();
snare->play();
}
void drumplayer::playbass(){
bass->stop();
bass->play();
}
void drumplayer::phonon_initiation(){
snare = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource("snare.wav"));
bass = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource("bass.wav"));
}
void drumplayer::playsnare(){
snare->stop();
snare->play();
}
void drumplayer::playbass(){
bass->stop();
bass->play();
}
To copy to clipboard, switch view to plain text mode
thanks for your help
Bookmarks