0
0

Hey guys,

I know this may sound stupid but i couldn’t play an mp3 file in visual C++. I kinda followed many tutorials but none of them actually worked.
I would like to know how to do the set up and the things step by step ( including how to import the right library and so on)
Thnx in advance,
taigi100
P.S. Im using microsoft visual C++ 2010

  • You must to post comments
0
0

Hi taigi100,

There are examples programs included in FMOD install directory. The playsound example should demonstrate what you need.

To set up a new application you need to do a couple of things. Firstly you need to link with the fmodex_vc.lib, that contains the symbols for the fmodex.dll file which you need to have next to your executable. Then you also need to include the fmod.hpp header in your source code.

  • You must to post comments
0
0

Iv saw the examples even before asking and tryed them and tryed to link but it didnt work idk why , now could u tell me plz how do i link it in vs c++ 2010 and as far as i know i have to #include<fmod.h> not fmod.hpp

  • You must to post comments
0
0

1>e:\omg\omg\sound.cpp(4): error C2143: syntax error : missing ‘;’ before ‘*’
1>e:\omg\omg\sound.cpp(4): error C4430: missing type specifier – int assumed. Note: C++ does not support default-int
1>e:\omg\omg\sound.cpp(4): error C4430: missing type specifier – int assumed. Note: C++ does not support default-int
1>e:\omg\omg\sound.cpp(9): error C3861: ‘FSOUND_Init’: identifier not found
1>e:\omg\omg\sound.cpp(12): error C3861: ‘FSOUND_Stream_Open’: identifier not found
1>e:\omg\omg\sound.cpp(13): error C3861: ‘FSOUND_Stream_Play’: identifier not found
1>e:\omg\omg\sound.cpp(21): error C3861: ‘FSOUND_Stream_Close’: identifier not found
1>e:\omg\omg\sound.cpp(22): error C3861: ‘FSOUND_Close’: identifier not found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

And my lines are:

include <conio.h>

include "fmod.h"(tried with .hpp too)

FSOUND_STREAM* handle;

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

//load and play sample
handle=FSOUND_Stream_Open("sample.mp3",0, 0, 0);
FSOUND_Stream_Play (0,handle);

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

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

i linked the file( added it to theproject cuz thats what i think it means)

  • You must to post comments
0
0

FSOUND is the prefix for FMOD3 functions, FMOD3 is no longer supported. You should be using FMOD Ex (FMOD4).

Getting the provided examples working would be a good first step. Open up examples.sln, right click on playsound project inside vs2010 and select "Set as start up project", then press F5 to compile and run.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.