From 1d9899c0d25760addc5d56928432155c51f254b3 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Sun, 9 Aug 2026 19:55:28 +0200 Subject: [PATCH] index --- scrbl/audio-encoder.scrbl | 2 +- scrbl/ffmpeg-decoder.scrbl | 2 +- scrbl/ffmpeg-definitions.scrbl | 2 +- scrbl/flac-decoder.scrbl | 17 ++++++++++++----- scrbl/intro.scrbl | 2 ++ scrbl/mp3-decoder.scrbl | 12 ++++++------ scrbl/opusfile-decoder.scrbl | 10 +++++----- scrbl/play-test.scrbl | 2 +- 8 files changed, 29 insertions(+), 20 deletions(-) diff --git a/scrbl/audio-encoder.scrbl b/scrbl/audio-encoder.scrbl index 06f017c..02e5e1b 100644 --- a/scrbl/audio-encoder.scrbl +++ b/scrbl/audio-encoder.scrbl @@ -166,7 +166,7 @@ The first backend version supports mono and stereo input. The FLAC backend uses the @tt{libFLAC} stream encoder. It writes interleaved integer PCM samples through the FLAC encoder API. When the requested output -sample rate differs from the decoded input format, @racketmodname[racket-audio/private/pcm-converter] +sample rate differs from the decoded input format, @tt{racket-audio/private/pcm-converter} uses @racketmodname[racket-audio/resampler], backed by @tt{libsoxr}, to perform PCM sample-rate conversion. Channel-count conversion is not handled by this SoXR path; keep the source channel count for encoder-side conversion. diff --git a/scrbl/ffmpeg-decoder.scrbl b/scrbl/ffmpeg-decoder.scrbl index 082f20e..ab836d6 100644 --- a/scrbl/ffmpeg-decoder.scrbl +++ b/scrbl/ffmpeg-decoder.scrbl @@ -12,7 +12,7 @@ @defmodule[racket-audio/ffmpeg-decoder] This module provides an audio decoder based on the FFmpeg audio shim. It -uses the lower-level @racketmodname[racket-sound/ffmpeg-ffi] module and presents a +uses the lower-level @racketmodname[racket-audio/ffmpeg-ffi] module and presents a callback-based decoder interface comparable to the other audio decoders. The native FFmpeg layer decodes audio to signed 32-bit interleaved PCM. diff --git a/scrbl/ffmpeg-definitions.scrbl b/scrbl/ffmpeg-definitions.scrbl index 75a3346..a5fdc8d 100644 --- a/scrbl/ffmpeg-definitions.scrbl +++ b/scrbl/ffmpeg-definitions.scrbl @@ -90,7 +90,7 @@ Small and stable structures, such as @tt{AVRational} and then calculates the correct field offsets for the current platform ABI and creates the corresponding pointer type, constructor, accessors and mutators. -The larger FFmpeg structures are handled by @racket[def-cstruct] from +The larger FFmpeg structures are handled by @tt{def-cstruct} from @filepath{private/cstruct-helper.rkt}. Structures such as @tt{AVCodecParameters}, @tt{AVStream}, @tt{AVFormatContext}, @tt{AVFrame} and @tt{AVPacket} are large and may differ between FFmpeg major versions. The diff --git a/scrbl/flac-decoder.scrbl b/scrbl/flac-decoder.scrbl index f5de7fc..4a59518 100644 --- a/scrbl/flac-decoder.scrbl +++ b/scrbl/flac-decoder.scrbl @@ -9,7 +9,7 @@ @title{flac-decoder} @author[@author+email["Hans Dijkema" "hans@dijkewijk.nl"]] -@defmodule[racket-audio/flac-decoder] +@defmodule[racket-audio/flac-decoder #:use-sources (racket-audio/flac-definitions)] This module provides a small decoder interface on top of the FLAC FFI layer. It opens a decoder for a file, reads stream metadata, @@ -33,12 +33,12 @@ exist, the result is @racket[#f]. Otherwise a native decoder handler is created with @racket[flac-ffi-decoder-handler], initialized with the file, and -wrapped in a @racket[flac-handle]. The given callbacks are stored +wrapped in a @racket[flac-handle?]. The given callbacks are stored in the handle. When metadata of type @racket['streaminfo] is processed and @racket[cb-stream-info] is a procedure, it is called with a -@racket[flac-stream-info] value. +@racket[flac-stream-info?] value. When decoded audio data is processed and @racket[cb-audio] is a procedure, it is called as @@ -80,7 +80,7 @@ with @racket['stopped-reading] and @racket[reading] is reset to Whenever pending metadata is available, it is processed with @racket[process-meta]. For metadata of type -@racket['streaminfo], a @racket[flac-stream-info] value is +@racket['streaminfo], a @racket[flac-stream-info?] value is constructed, stored in the handle, and passed to the stream-info callback. @@ -110,7 +110,7 @@ metadata is processed and the stored stream info is returned. Otherwise the result is @racket[#f]. Only metadata of type @racket['streaminfo] is converted into a -@racket[flac-stream-info] value by this module. +@racket[flac-stream-info?] value by this module. } @defproc[(flac-stop [handle flac-handle?]) void?]{ @@ -125,6 +125,13 @@ The procedure prints timing information before and after the wait. } +@defproc[(flac-duration [handle flac-handle?]) + (or/c #f exact-nonnegative-integer?)]{ + +Returns the rounded duration in seconds, or @racket[#f] while no stream +information is available. +} + @section{Diagnostic bindings} @defthing[kinds hash?]{ diff --git a/scrbl/intro.scrbl b/scrbl/intro.scrbl index 4d55518..3eccf26 100644 --- a/scrbl/intro.scrbl +++ b/scrbl/intro.scrbl @@ -27,6 +27,8 @@ @title{@elem{Introduction racket-audio}} +@defmodule[racket-audio] + @;;title{racket-audio} @author[@author+email["Hans Dijkema" "hans@dijkewijk.nl"]] diff --git a/scrbl/mp3-decoder.scrbl b/scrbl/mp3-decoder.scrbl index 8bd7f9c..4f91a3a 100644 --- a/scrbl/mp3-decoder.scrbl +++ b/scrbl/mp3-decoder.scrbl @@ -16,10 +16,10 @@ reports stream information through a callback, streams decoded PCM buffers, and supports stopping and seeking. The module is intended to be used through -@racketmodname[racket-sound/audio-decoder], but its procedures can also +@racketmodname[racket-audio/audio-decoder], but its procedures can also be used directly. -@section{Validation} +@section[#:tag "mp3-decoder-validation"]{Validation} @defproc[(mp3-valid? [mp3-file any/c]) boolean?]{ @@ -27,14 +27,14 @@ Returns #t. The current implementation does not inspect mp3-file. This procedure exists to satisfy the reader interface used by -@racketmodname[racket-sound/audio-decoder]. +@racketmodname[racket-audio/audio-decoder]. Basic validation such as file existence and extension matching is performed in the higher-level module. This procedure therefore acts as an additional hook and currently accepts all inputs. } -@section{Opening} +@section[#:tag "mp3-decoder-opening"]{Opening} @defproc[(mp3-open [mp3-file* (or/c path? string?)] [cb-stream-info procedure?] @@ -68,7 +68,7 @@ where info is a mutable hash containing at least: @item{'total-samples}] } -@section{Reading} +@section[#:tag "mp3-decoder-reading"]{Reading} @defproc[(mp3-read [handle struct?]) any/c]{ @@ -127,7 +127,7 @@ If the total number of samples is unavailable or equal to -1, this procedure has no effect. } -@section{Stopping} +@section[#:tag "mp3-decoder-stopping"]{Stopping} @defproc[(mp3-stop [handle struct?]) void?]{ diff --git a/scrbl/opusfile-decoder.scrbl b/scrbl/opusfile-decoder.scrbl index 16797e5..86d56dc 100644 --- a/scrbl/opusfile-decoder.scrbl +++ b/scrbl/opusfile-decoder.scrbl @@ -71,10 +71,10 @@ Example: This binding is also re-exported by @racketmodname[racket-audio/audio-decoder] and by -@racketmodname[racket-audio/main]. +@racketmodname[racket-audio]. } -@section{Validation} +@section[#:tag "opusfile-decoder-validation"]{Validation} @defproc[(opusfile-valid? [audio-file any/c]) boolean?]{ @@ -86,7 +86,7 @@ when the file is opened by @racket[opusfile-open]. The generic decoder layer also performs extension and existence checks before opening a file. } -@section{Opening} +@section[#:tag "opusfile-decoder-opening"]{Opening} @defproc[(opusfile-open [audio-file (or/c path? string?)] [cb-stream-info procedure?] @@ -125,7 +125,7 @@ where @racket[info] is a mutable hash containing at least: or the value reported by @tt{libopusfile}.}] } -@section{Reading} +@section[#:tag "opusfile-decoder-reading"]{Reading} @defproc[(opusfile-read [handle struct?]) any/c]{ @@ -176,7 +176,7 @@ a target decoded sample and stores it as a pending seek request. The actual native seek is performed later by @racket[opusfile-read]. } -@section{Stopping} +@section[#:tag "opusfile-decoder-stopping"]{Stopping} @defproc[(opusfile-stop [handle struct?]) void?]{ diff --git a/scrbl/play-test.scrbl b/scrbl/play-test.scrbl index 7b2c2d0..09bba72 100644 --- a/scrbl/play-test.scrbl +++ b/scrbl/play-test.scrbl @@ -12,7 +12,7 @@ @defmodule[racket-audio/play-test] -The @racketmodname[racket-audio/play-test.rkt] module is a small integration test and +The @racketmodname[racket-audio/play-test] module is a small integration test and usage example for @racketmodname[racket-audio/audio-player]. It is not the public playback API itself; normal applications should use @racketmodname[racket-audio/audio-player] directly. This module shows how a program can create an audio player, observe