0
0

This small piece of code crashes FMOD on my windows XP system.
Is this normal, and if so what am I doing wrong?
Before crashing the app is displaying the message : “FMOD could not play the sample (2)”. not being able to play it is understandable, not beeing able to free it is rather surprising. Sample used comes from windows media folder.

[code:1oodnvgf]

include <stdlib.h>

include <stdio.h>

include "fmod.h"

int main()
{
FSOUND_SAMPLE *handle;

if(!FSOUND_Init(44100,32,0))
{
printf("FMOD could not init (1)\n");
exit(0);
}

if( (handle = FSOUND_Sample_Load(FSOUND_UNMANAGED,"recycle.wav",FSOUND_HW3D,0,0)) == NULL)
{
printf("FMOD could not load sample\n");
exit(0);
}

if( FSOUND_PlaySound(FSOUND_FREE,handle) == -1)
{
printf("FMOD could not play the sample (1)\n");
exit(0);
}

FSOUND_StopSound(FSOUND_ALL);

FSOUND_Close();

if( !FSOUND_SetMaxHardwareChannels(0))
{
printf("FMOD could not set max hardware channels\n");
}

if(!FSOUND_Init(44100,32,0))
{
printf("FMOD could not init (2)\n");
exit(0);
}

if( FSOUND_PlaySound(FSOUND_FREE,handle) == -1)
{
printf("FMOD could not play the sample (2)\n");
FSOUND_Sample_Free(handle);
FSOUND_Close();
exit(0);
}

FSOUND_Close();
}
[/code:1oodnvgf]

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.