#include #include #include #include #include "fmod.h" #include "fmod_errors.h" /* optional */ #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif int main() { // Sound FSOUND_SAMPLE * sound; // Music FSOUND_STREAM * music; // Initialize fmod if (!FSOUND_Init(44100, 32, FSOUND_INIT_USEDEFAULTMIDISYNTH)) { printf("Error!\n"); printf("%s\n", FMOD_ErrorString(FSOUND_GetError())); return 1; } // Load sound sound = FSOUND_Sample_Load(/*FSOUND_FREE*/FSOUND_UNMANAGED, /*"boom.wav"*/"L:\\iis3root\\bratislaboys.mp3", FSOUND_NORMAL, 0, 0); if (!sound) { printf("Error!\n"); printf("%s\n", FMOD_ErrorString(FSOUND_GetError())); return 1; } FSOUND_Sample_SetMode(sound, FSOUND_LOOP_NORMAL); /* this wav has loop points in it which turns looping on.. turn it off! */ // Play FSOUND_PlaySound(FSOUND_FREE, sound); #if 0 { int channel; channel = FSOUND_PlaySoundEx(FSOUND_FREE, sound, NULL, TRUE); FSOUND_SetPaused(channel, FALSE); } #endif getch(); //Sleep( 10000 ); // Free FSOUND_Sample_Free(sound); // Close sound FSOUND_Close(); return 0; }