0
0

I have a strange problem appearing,
the first time i load a sample and play it,
it outputs correctly, but later in my app,
i have to delete sounds (to save memory), with a Stop and then
a Delete sound, and later on, i reload them,
but this time, no output …

any idea ?

thanks
francois

  • You must to post comments
0
0

[quote="Majestik":4g4b2lu6]I have a strange problem appearing,
the first time i load a sample and play it,
it outputs correctly, but later in my app,
i have to delete sounds (to save memory), with a Stop and then
a Delete sound, and later on, i reload them,
but this time, no output …

any idea ?

thanks
francois[/quote:4g4b2lu6]

I just tried it like this and it works:

FSOUND_SAMPLE *pSample;
int channel;

init function:
pSample = FSOUND_Sample_Load(FSOUND_FREE, “whatever.wav”, FSOUND_HW3D, 0);
channel = FSOUND_PlaySound(FSOUND_FREE, pSample);

update function:
if(!FSOUND_IsPlaying(channel))
{
FSOUND_StopSound(channel);
FSOUND_Sample_Free(pSample);
pSample = FSOUND_Sample_Load(FSOUND_FREE, “whatever.wav”, FSOUND_HW3D, 0);
channel = FSOUND_PlaySound(FSOUND_FREE, pSample);
}

A very costly way to loop a sound 😀

  • You must to post comments
0
0

sorry about the question,
in fact i had a 3D positioning problem
so i could not hear the sound the second time.
anyway thanks for helping!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.