I have troubles opening several files with fmod. I initialize a System for each opening, then release it.

The problem is that the second opening crashes with error 47 :
FMOD error! (47) Error initializing output device.

Has anybody encountered this problem ?
Any clue ?


P.S. : I attach a short test source in C++.
P.S.2 : My OS is Mandriva 2005 LE (10.2) and I use version fmodapi40034 (but I have the same problem with fmodapi40107


include <assert.h>

include <fmodex/fmod.hpp>

include <fmodex/fmod_errors.h>

include <iostream>

include <string>

include <assert.h>

include <stdio.h>

void ERRCHECK( FMOD_RESULT l_status) {
if( l_status != FMOD_OK) {
printf("FMOD error! (%d) %s\n", l_status, FMOD_ErrorString( l_status));

void playFile( std::string const& p_filename);

int main( int p_argc, char* p_argv[]) {
assert( p_argc == 3);
playFile( p_argv[ 1]);
playFile( p_argv[ 2]);
return 0;

void playFile( std::string const& p_filename) {
std::cout << "playFile" << std::endl;
Create a System object and initialize.
l_system = 0;
unsigned int l_version = 0;
FMOD_RESULT l_status = FMOD::System_Create( &l_system);
ERRCHECK( l_status);
l_status = l_system->getVersion( &l_version);
ERRCHECK( l_status);
if( l_version < FMOD_VERSION) {
printf( "Error! You are using an old version of FMOD %08x."
" This program requires %08x\n", l_version,
exit( -1);
l_status = l_system->init(1, FMOD_INIT_NORMAL, 0);
ERRCHECK( l_status);
FMOD::Sound* l_sound = 0;
FMOD_RESULT l_result =
l_system->createSound( p_filename.c_str(), FMOD_SOFTWARE | FMOD_2D, 0,
ERRCHECK( l_result);
l_result = l_sound->release();
ERRCHECK( l_result);
l_result = l_system->close();
ERRCHECK( l_result);
l_result = l_system->release();
ERRCHECK( l_result);

  • You must to post comments

Solved by reusing the System.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.