Optional raw-output, diagnostics, recording, and whole-mix effect interfaces.
Syntax
#include Once "sfxlib_raw.bi"
#include Once "sfxlib_effects.bi"
Description
The ordinary
sfxlib commands are the stable BASIC-facing interface. These two headers expose lower-level controls in the
sfxlib namespace for programs that generate their own sample stream, verify final output, or need the built-in whole-mix echo.
Raw output and recording
- RawOpen() starts an exclusive caller-clocked stream and returns its sample rate. RawClose() ends it.
- RawWrite(samples, frames, channels) accepts interleaved SINGLE samples in the range -1.0 through 1.0. It returns accepted frames, zero when the queue is full, or -1 for invalid input or initialization failure.
- RawUnderruns() and OutputUnderruns() report device starvation. OutputSampleRate() reports the active device rate.
- OutputCaptureStart(), OutputCaptureReserve(frames), OutputCaptureStop(), and OutputCaptureSave(filename) record the final driver-accepted output and save 16-bit PCM WAV. This is output recording, not microphone capture.
The sample pointer passed to
RawWrite must address at least
frames * channels values. Producers should handle partial or zero-frame acceptance without overwriting or discarding the unaccepted tail.
Whole-mix echo
Echo(wet, delay_seconds, feedback) enables stereo ping-pong echo. Wet and feedback are in the range 0.0 through 1.0, feedback is limited to 0.95, and delay is 0.01 through 2.0 seconds. A wet value of zero disables the effect. EchoReset() clears the delay line and EchoEnabled() reports the current state.
Version
- Since fbc 1.20.1; output recording and echo were expanded during 1.20.2 through 1.20.4 development
See also