I know I’m probably missing something quite simple here but I can’t quite figure out what it is. I have the following code block to play a sound in software mode…
result = FMOD::System_Create(&system);
result = system->init(32, FMOD_INIT_NORMAL, 0); ERRCHECK(result); system->setSoftwareChannels(0); result = system->createSound("F:\\MP3s\\AudioTrack 02.mp3", FMOD_LOOP_OFF | FMOD_2D | FMOD_SOFTWARE, 0, &sound); ERRCHECK(result); result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); ERRCHECK(result);[/code:15axxr3g]
Only I don’t hear anything. All the return values from these functions tell me things are working out fine (ie FMOD_OK) but I don’t here the MP3 playing. Figure this is something to do with software mode as when I change the flags used in createSound to just use FMOD_DEFAULT the sound plays fine.
- RobSegal asked 12 years ago
Ok so I would imagine that’s one of the mistakes I’ve made. However if I take that line out or set the # of software channels to be something greater than 0 I still don’t hear something playing. I started thinking maybe this was something with my sound card but the examples which use software mode work great. Me thinks something else is afoot…
Looks like that was it brett. I put in a loop after the playSound call and eventually the sound does start. I would imagine this is not much of an issue for the examples as they use much smaller files than your standard mp3 song file.
Anyways problem solved and I’ve learned something out of the whole ordeal. Thanks for your help brett.
Something which doesn’t make complete sense to me though is if I debug the program I’m writing so it breaks just after the playSound call and wait for the sound it doesn’t play. But if I do this in hardware mode in plays almost immediately after the call. I would imagine there’s some internal stuff going on there for software mode which takes a bit longer to get going?
Please login first to submit.