Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

AdrianK

macrumors 68020
Original poster
Feb 19, 2011
2,230
2
I'm trying to create a simple app in C for playing mp3s. This is my first experience in working with libraries.

I've got to a stage where I'm not sure what I'm doing wrong.

I'm using this code, as suggested to another user on stack overflow:
Code:
#include <conio.h>
#include "inc/fmod.h"

FSOUND_SAMPLE* handle;

int main ()
{
   // init FMOD sound system
   FSOUND_Init (44100, 32, 0);

   // load and play mp3
   handle=FSOUND_Sample_Load (0,"my.mp3",0, 0, 0);
   FSOUND_PlaySound (0,handle);

   // wait until the users hits a key to end the app
   while (!_kbhit())
   {
   }

   // clean up
   FSOUND_Sample_Free (handle);
   FSOUND_Close();
}

conio.h is required which links properly in my include (sourced from libconio), and fmod is also correctly linked (sourced from fmod api).

Despite that, all of the 'FSOUND' functions are appearing alien to Xcode, any idea what I'm doing wrong?

I've uploaded my Xcode project here.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.