This commit is contained in:
2026-04-09 13:04:42 +02:00
parent ddfc674453
commit c5d3ca5d7a
5 changed files with 27 additions and 20 deletions

View File

@@ -8,6 +8,7 @@
(prefix-in scm: "libao-async.rkt")
ffi/unsafe
data/queue
"private/utils.rkt"
)
(provide ao-open-live
@@ -55,10 +56,10 @@
(lambda (my-handle)
(hash-for-each devices
(lambda (handle-num device)
(displayln (format "closing ao handle ~a" handle-num))
(dbg-sound "closing ao handle ~a" handle-num)
(ao-close handle-num)))
(set! devices (make-hash))
(displayln "shutting down ao")
(dbg-sound "shutting down ao")
(ao_shutdown)
(plumber-flush-handle-remove! my-handle)
)))
@@ -157,13 +158,13 @@
(if (number? handle)
(let ((ao-device (hash-ref devices handle #f)))
(unless (eq? ao-device #f)
(displayln (format "Closing ao device ~a" ao-device))
(dbg-sound "Closing ao device ~a" ao-device)
(close-device #f ao-device)
(hash-remove! devices handle)))
(let ((handle-num (ao-handle-handle-num handle)))
(let ((ao-device (hash-ref devices handle-num #f)))
(unless (eq? ao-device #f)
(displayln (format "ao-device = ~a" ao-device))
(dbg-sound "ao-device = ~a" ao-device)
(close-device handle ao-device)
(hash-remove! devices handle-num)))
)