audio-play! returns the file id.

The file id is now a randomized number
This commit is contained in:
2026-05-17 20:19:06 +02:00
parent f706d4e8e6
commit 65ca59bef8
7 changed files with 170 additions and 499 deletions
+7 -2
View File
@@ -143,6 +143,8 @@
(set-audio-play-state! handle (evt-data e))
(cb-state* (evt-data e)))
((is-event? e 'audio-done) (cb-eof*))
((is-event? e 'exception)
(err-sound "audio-player: exception event: ~a" e))
(else (warn-sound "audio-player: unknown event ~a" e))
)
(loop))
@@ -175,8 +177,11 @@
)
(define/contract (audio-play! handle audio-file)
(-> audio-play? path-string? symbol?)
((audio-play-rpc handle) 'open audio-file))
(-> audio-play? path-string? number?)
(let ((result ((audio-play-rpc handle) 'open audio-file)))
(when (eq? result 'error)
(error "Got an error from the placed audio player"))
(cadr result)))
(define/contract (audio-pause! handle paused)
(-> audio-play? boolean? symbol?)