Automagic parameterization of the audio player.

This commit is contained in:
2026-07-03 23:04:20 +02:00
parent 2a2616763d
commit e381260773
+16 -1
View File
@@ -6,6 +6,7 @@
racket/runtime-path racket/runtime-path
uni-channel uni-channel
"audio-placed-player.rkt" "audio-placed-player.rkt"
"opusfile-decoder.rkt"
"private/utils.rkt" "private/utils.rkt"
"private/remote-utils.rkt" "private/remote-utils.rkt"
(prefix-in ffi: ffi/unsafe) (prefix-in ffi: ffi/unsafe)
@@ -35,6 +36,7 @@
audio-ao-buf-ms! audio-ao-buf-ms!
audio-ao-buf-ms audio-ao-buf-ms
audio-known-exts? audio-known-exts?
audio-parameterize!
audio-param! audio-param!
audio-param audio-param
audio-remote-path audio-remote-path
@@ -243,7 +245,8 @@
(λ (h) (λ (h)
(when (audio-play? h) (when (audio-play? h)
(rpc 'quit)))) (rpc 'quit))))
(audio-parameterize! handle)
handle) handle)
) )
) )
@@ -353,6 +356,18 @@
(define/contract (audio-param handle param) (define/contract (audio-param handle param)
(-> audio-play? symbol? any?) (-> audio-play? symbol? any?)
((audio-play-rpc handle) 'param param)) ((audio-play-rpc handle) 'param param))
(define/contract (audio-parameterize! handle)
(-> audio-play? void?)
(void
(let* ((opus-fmt (current-opusfile-output-format))
(opus-bits (if (eq? opus-fmt 's24) 24 16))
)
(audio-param! handle 'opus-bits opus-bits)
)
)
)