The problem was, that I forgot to system->update()
.
The code code should look like this:
int count = 1;
FMOD::System *system = NULL;
FMOD::System_Create(&system);
system->init(100, FMOD_INIT_NORMAL, 0);
while(true)
{
FMOD::Sound *sound = NULL;
system->createSound("test.wav", FMOD_DEFAULT, FMOD_DEFAULT ,&sound);
FMOD::Channel *channel = NULL;
FMOD_RESULT result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
system->update(); // very important!!!
cout << "count: " << count << ", " << result;
count++;
struct timespec ts;
ts.tv_sec = 1;
nanosleep(&ts, NULL);
}