有人能解释一下为什么我不能同时播放两种声音吗?
这是代码的一部分:
#include <fmod.h>
FMOD_SYSTEM *system;
FMOD_SOUND *dooropen;
FMOD_SOUND *keydoor;
FMOD_SOUND *slap;
FMOD_SOUND *bomb;
FMOD_SOUND *scratch;
FMOD_SOUND *secret;
FMOD_SOUND *pickey;
FMOD_SOUND *caisse;
FMOD_RESULT resultat1;
FMOD_RESULT resultat2;
FMOD_RESULT resultat3;
FMOD_RESULT resultat4;
FMOD_RESULT resultat5;
FMOD_RESULT resultat6;
FMOD_RESULT resultat7;
FMOD_RESULT resultat8;
FMOD_System_Create(&system);
FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, NULL);
resultat1 = FMOD_System_CreateSound(system, "sound/door-open.mp3", FMOD_CREATESAMPLE, 0, &dooropen);
resultat2 = FMOD_System_CreateSound(system, "sound/key-door.wav", FMOD_CREATESAMPLE, 0, &keydoor);
resultat3 = FMOD_System_CreateSound(system, "sound/slap.wav", FMOD_CREATESAMPLE, 0, &slap);
resultat4 = FMOD_System_CreateSound(system, "sound/bomb.wav", FMOD_CREATESAMPLE, 0, &bomb);
resultat5 = FMOD_System_CreateSound(system, "sound/scratch.wav", FMOD_CREATESAMPLE, 0, &scratch);
resultat6 = FMOD_System_CreateSound(system, "sound/secret.wav", FMOD_CREATESAMPLE, 0, &secret);
resultat7 = FMOD_System_CreateSound(system, "sound/pickey.wav", FMOD_CREATESAMPLE, 0, &pickey);
resultat8 = FMOD_System_CreateSound(system, "sound/caisse.wav", FMOD_CREATESAMPLE, 0, &caisse);
我这样称呼我的声音:
FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, scratch, 0, NULL);
FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, bomb, 0, NULL);
我认为有一个频道问题,因为当我播放“炸弹”时,我能听到它(这个声音大约是 3 秒),但如果“刮擦”的声音发生,“炸弹”的声音就会停止......