added extra debug info

This commit is contained in:
2026-04-15 09:52:00 +02:00
parent df27105a06
commit 9e98d7d8c6

View File

@@ -50,13 +50,17 @@
(set-ao-handle-channels! handle channels)
(set-ao-handle-rate! handle rate)
(info-sound "ao-open-live ~a ~a ~a ~a" bits rate channels byte-format)
(let ((player (ffi:ao_create_async bits rate channels byte-format)))
(set-ao-handle-async-player! handle player)
(if (eq? player #f)
(begin
(err-sound "ao-open-live - cannote create player")
(set-ao-handle-closed! handle #t)
handle)
(begin
(info-sound "ao-open-live - created player")
(set-ao-handle-closed! handle #f)
handle
)
@@ -67,6 +71,7 @@
(define (ao-close handle)
(unless (eq? (ao-handle-async-player handle) #f)
(info-sound "ao-close - closing handle")
(ffi:ao_stop_async (ao-handle-async-player handle))
(set-ao-handle-async-player! handle #f)
)
@@ -83,7 +88,9 @@
(endianess (ao-handle-byte-format handle))
(buf-info (ffi:make-BufferInfo_t buf-type bits rate channels endianess))
)
(dbg-sound "ao-play ~a ~a" at-time-in-s music-duration-s)
(unless (ao-valid? handle)
(err-sound "Cannot play on an invalid ao-device")
(error "Cannot play on an invalid ao-device"))
(ffi:ao_play_async (ao-handle-async-player handle)
(exact->inexact at-time-in-s)
@@ -95,6 +102,7 @@
)
(define (ao-pause handle pause)
(dbg-sound "ao-pause ~a" pause)
(ffi:ao_pause_async (ao-handle-async-player handle) (if (eq? pause #f) 0 1))
)