0
0

Hi everyone!

I’m right now doing my first steps into sound programming. After I didn’t get the examples compiled with gcc under win32, I tried to translate the realtime-part of the C-“record”-example to Delphi.

It works, at least during the first five seconds (which is the sample length). Afterwards, it keeps recording (according to the record position), but it doesn’t play anything anymore (play position stops when it reaches “0” again).

How can this be? As far as I do understand it, one doesn’t have to set looping for recording or playing but for the sample itself, and since looping works for recording, it should also do this for playing.

Can you give me any hints?

If you want to take a look at my code:
http://www.dreifinger.de/download/temp/ … xample.pas

Thanks in advance,
Ulf Schaper

PS: I’m using Delphi 6 Professional Update Pack 2, Windows XP Pro. I don’t think it has anything to do with my system itself since the precompiled record example works fine.

  • You must to post comments
0
0

Set the loop mode of the sample after you allocate the sample, not before.

[code:a0h27q5y]
samp1 := FSOUND_Sample_Alloc(FSOUND_UNMANAGED, RECORDLEN, FSOUND_STEREO or FSOUND_16BITS , RECORDRATE, 255, 128, 255);
FSOUND_Sample_SetMode(samp1, FSOUND_LOOP_NORMAL);
[/code:a0h27q5y]

  • You must to post comments
0
0

Thanks a lot for the immediate answer, Andrew!
I swapped those both lines, now it works as expected!

Ulf

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.