Previous Topic Index Next Topic
[API function]

FSOUND_Record_StartSample

Starts recording into a predefined sample using the sample's default playback rate as the recording rate.

signed char F_API FSOUND_Record_StartSample(
FSOUND_SAMPLE *sptr,
signed char loop
);

Parameters

sptr The sample to record into.
loop TRUE or FALSE flag whether the recorder should keep recording once it has hit the end,
and start from the start again, therefore creating a continuous recording session into that
sample buffer. Looping the recording buffer is good for realtime processing of recorded
information, as you can record and playback the sample at the same time.

Return Value

On success, TRUE is returned.
On failure, FALSE is returned.

Remarks

If you want to play back the sample at the same time is is recording, you will have to play the sound and try and keep it just behind the recording cursor.
Under FSOUND_OUTPUT_OSS mode, it is single duplex, so playback will stop when recording is in progress! Try FSOUND_OUTPUT_ALSA for full duplex as they have better drivers in this respect.
-------------
The recording/playback rates are slightly innacurate and are not identical (ie 44100.0 for playback, 44100.1 for recording), so one could possibly be faster or slower than the other. In this case the recording and the playback cursor could overlap, and the output will sound corrupted.
To counter this you might adjust the playback frequency of the channel you are playing the record sample on while it plays, using FSOUND_GetCurrentPosition and FSOUND_Record_GetPosition as calibration points.
In the recording sample there is an example of trying to play back sound as it records, and the mechanism to try and keep the 2 cursors a safe distance from each other is employed.
___________________
Supported on the following platforms : Win32, WinCE, Linux, Macintosh

See Also

FSOUND_GetCurrentPosition , FSOUND_Record_GetPosition , FSOUND_Record_Stop

This document copyright ©Firelight Technologies, Pty, Ltd, 1999-2002. All rights reserved.
Generated Fri Sep 05 18:50:23 2003 by SourceDoc v0.10, the automated source code documenter.