mp3 support, based on mpg123

This commit is contained in:
2026-04-22 13:28:37 +02:00
parent bba44733ab
commit 4c22dd54cc
7 changed files with 575 additions and 116 deletions
+15 -1
View File
@@ -520,10 +520,14 @@
)
(define (new)
(set! fl (FLAC__stream_decoder_new))
(dbg-sound "flac-ffi 'new")
(if (eq? fl #f)
(set! fl (FLAC__stream_decoder_new))
(error "flac handler already initialized (new)"))
fl)
(define (init file)
(dbg-sound "flac-ffi 'init")
(let ((r (FLAC__stream_decoder_init_file
fl
file
@@ -534,6 +538,15 @@
(set! flac-file file)
r))
(define (delete)
(dbg-sound "flac-ffi 'delete")
(if (eq? fl #f)
(error "flac handler has already been deleted")
(begin
(FLAC__stream_decoder_delete fl)
(set! fl #f)))
)
(define (process-single)
(FLAC__stream_decoder_process_single fl))
@@ -583,6 +596,7 @@
[(eq? cmd 'new) (new)]
[(eq? cmd 'init) (init (car args))]
[(eq? cmd 'delete) (delete)]
[(eq? cmd 'process-single) (process-single)]
[(eq? cmd 'get-buffers) (buffer->vectorlist (car args) (cadr args) (caddr args))]