um, hello everyone. we’re making a game for school and need to install fmod to get sound working. we’re using codewarrior 8.3 with cmu graphics 2.0. we downloaded the correct files, but aren’t exactly sure what to do with them.
um, thanks to anyone who helps!
ok i think i got most of the functions, i just don’t understand what i do with them.
say for example i wanted to play a long mp3 file. would i do it like this:
[b:1avskt13]FSOUND_Stream_OpenFile (C://Sean!/blah.mp3, 1, 1);[/b:1avskt13]
[b:1avskt13]FSOUND_Stream_Play (int channel, FSOUND_STREAM *stream);[/b:1avskt13]
um, i’m not sure what to put in the numbers in the first function there, or what to put AT ALL in the second one.. a little help please?
here’s a copy of my code:
include “C://Sean!/SBHT!2/FMOD Sound Library/api/inc/fmod.h”
// setup all sounds
FSOUND_Init (44100, 32, 0);
// loads MUSIC to memory (MOD, S3M, XM, IT, or MID)
FMUSIC_MODULE * F_API FMUSIC_LoadSong (const char *name);
// plays MUSIC
signed char F_API FMUSIC_PlaySong (FMUSIC_MODULE *mod);
// loads SOUND EFFECT (small file) to memory for (WAV, MP2, MP3, OGG or RAW)
FSOUND_SAMPLE * F_API FSOUND_Sample_Load (int index, const char *name_or_data, unsigned int inputmode, int memlength);
// plays SOUND EFFECT
int F_API FSOUND_PlaySound (int channel, FSOUND_SAMPLE *sptr);
// loads MUSIC (big file) to memory for (WAV, MP2, MP3, OGG or RAW)
FSOUND_STREAM * F_API FSOUND_Stream_OpenFile (const char *filename, unsigned int mode, int memlength);
// plays MUSIC
int F_API FSOUND_Stream_Play (int channel, FSOUND_STREAM *stream);
Let me fix that code for you.
pStream = FSOUND_Stream_OpenFile("C:/Sean!/blah.mp3",1,1);
“int channel” = anything you like up to the value of the second parameter of FSOUND_Init(); preferably FSOUND_FREE to autoselect.
“FSOUND_STREAM* stream” = pointer to loaded stream, returned by FSOUND_Stream_OpenFile.
A little tip: looking at the source code for the FMOD samples may help.
Please login first to submit.