´lut tt le monde j´ai un prob avec la librairie Fmod sur Dev-C++ 4
j´essais de lire un mp3 ( donc avec stream) mais y a des erreurs
- include < windows.h>
- include < fmod.h>
- pragma comment(lib,"fmodvc.lib")
WNDCLASS wc;
MSG msg;
HWND hWnd;
FSOUND_STREAM * notre_son;
int Musique()
{
FSOUND_Init(44100, 32, 0);
notre_son = FSOUND_Stream_OpenFile("kb-fr08.mp3", FSOUND_NORMAL, 0);
FSOUND_Stream_Play(FSOUND_FREE, notre_son);
return 0;
}
int FreeMem()
{
FSOUND_Stream_Stop(notre_son);
FSOUND_Stream_Close(notre_son);
FSOUND_Close();
return 0;
}
LRESULT CALLBACK WindowProc ( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch ( uMsg)
{
case WM_CREATE:
Musique();
break;
case WM_CLOSE:
FreeMem();
PostQuitMessage ( 0);
break;
default:
return DefWindowProc ( hwnd, uMsg, wParam, lParam);
break;
}
return 0;
}
int WINAPI WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int CmdShow)
{
wc.style = CS_OWNDC;
wc.lpfnWndProc = WindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = ( HBRUSH)GetStockObject(LTGRAY_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = " Fmod";
RegisterClass(&);
hWnd = CreateWindow
( "Fmod", " http://www.fmod-fr.tk",
WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE,
0, 0, 150, 25, NULL, NULL, hInstance, NULL
) ;
while ( GetMessage(&, NULL, 0, 0))
{
TranslateMessage(&);
DispatchMessage(&);
}
return 0;
}
le code est un sample disponible sur http://www.fmod-fr.tk
voici les erreurs qu´indique mon compilateur
d:\programmation\codingc++\fmod\fmodgo.cpp: In function `int Musique()´:
d:\programmation\codingc++\fmod\fmodgo.cpp:15: implicit declaration of function `int FSOUND_Stream_OpenFile(...)´
d:\programmation\codingc++\fmod\fmodgo.cpp:15: assignment to `FSOUND_STREAM *´ from `int´ lacks a cast
merci à tout ceux qui daigneront m´aider 