stuck on the simplest possible thing

I am stuck on something so simple…
I can’t get playSound to work. I’m writing an OpenGl program, and have been generating sine tones(DSP’s) based on events with great success. Now I want to play an audio file (to eventually analyze the spectrum of), and the program runs but the audio file doesn’t play…

I’ve tried:
- creating and playing the sound in my main function,

FMOD::Channel* sChannel;
FMOD::Sound* sound;
Asystem->createSound(“jaguar.mp3”, FMOD_DEFAULT, 0, &sound);
Asystem->playSound(sound, 0, false, &sChannel);

            //and waiting for user input
std::cout << "Press return to quit." << std::endl;

- creating a Sound class, a newSound function, and unpausing the sound’s channel in my glut Display func (called once per frame)

class Sound {
FMOD::Channel *soundchannel;
FMOD::DSP *sounddsp;
FMOD::Sound *sound;


FMOD::Channel* getChannel() {
    return soundchannel;

Sound(FMOD::Channel* sc, FMOD::DSP* sdsp, FMOD::Sound* sound):
soundchannel(sc), sounddsp(sdsp), sound(sound)


std::vector soundVec;

void newSound(){
FMOD::Channel* sChannel;
FMOD::Sound* sound;

result = Asystem->createDSPByType(

Asystem->createSound("jaguar.mp3", FMOD_DEFAULT, 0, &sound);

Asystem->playSound(sound, 0, false, &sChannel);
Sound newSound = Sound(sChannel, sDSP, sound);



for (int i = 0; i < soundVec.size(); i++){
FMOD::Channel* cchannel = soundVec[i].getChannel();


Asystem-> update();

and have also, in fear that I wasn’t specifying the filepath of the audio file, copied the .wav file (taken from the fmod examples) into the sub folder containing my project as well as it’s parent folder

I’ve had no success, and am seriously bummed out that I’m stuck on what’s probably the simplest possible thing to do with FMOD.

I know there are more interesting questions to answer, but any help would really be so appreciated.


Is that code stripped down or are you not checking any return codes anywhere? They would probably tell you what’s wrong.

Thanks for your response… I haven’t been error checking.
I just did, and yup I get

FMOD error! (18) File not found.
Program ended with exit code: 255

Does this mean I haven’t specified the file path correctly? I’ve added the file to my xcode project, the project folder and its parent folder. I’m just calling

Asystem->createSound(“jaguar.wav”, FMOD_DEFAULT, 0, &sound);

Thanks for identifying the problem… could you suggest a fix? I’d really appreciate it.

yes, the problem is probably that you haven’t got the path right. its the same as if fopen() returned a failure not being able to find your file.

it’s working. thanks so much for taking the time.