Home > other >  Please help me with questions about the background music. Thank you very much!!!!!
Please help me with questions about the background music. Thank you very much!!!!!

Time:09-24

[functional description] :

Board games, the need to play is similar to "a 2", "a pair of 2" the voice, so prepared three wav files (yige. Wav, yidui. Wav, 2. Wav), were used to send "a", "a", "2" three voice,

[problem description] :
1. When a player with a "2", the code to use SimpleAudioEngine class playBackgroundMusic function to play continuously under the "yige. Wav" and "2. Wav" two audio files, but the actual can only play a "2". From the point code walkthrough, playBackgroundMusic will release a play before the object, leading to an audio file is not in front of the was over, began to play an audio file.

2. To upgrade to 3.9 cocos2dx version, using AudioEngine play2d under class to play "yige. Wav", and through setFinishCallback callback function, to play "2. Wav", the intervals between the two voices, experience is very poor.

You, how do you solve the similar problem? Or can only be recorded "a 2" and "a pair of 2" this audio file? That so, recorded audio file will be a lot more.

CodePudding user response:

Put these a few sound file synthesis, such as synthetic here is "a 2" and "a pair of 2" both sound, so there will be no gap between, secondly, before you use is playBackgroundMusic, this belongs to the sound, so change to sound would be a good play,

CodePudding user response:

Used the cocos, but if your audio engine can operate on sampling, filling them in buffer, you can put the N sampling together play,
Such as putting a and 2 a PCM play, or a pair of a PCM and 2 synthesis, dynamic consolidation, so you only play a audio,
  • Related