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
+4 -2
View File
@@ -76,10 +76,12 @@ is invalidated and @racket[audio-play?] returns @racket[#f].}
@defproc[(audio-play! [player audio-play?]
[audio-file path-string?])
symbol?]{
number?]{
Starts playback of @racket[audio-file]. The file is opened by the worker side,
a decoder is selected, and audio feeding begins asynchronously. In normal use
the return value is @racket['ok].
the return value is @racket[music-id], where @tt{music-id} is the
given @tt{id}, a @tt{number? >= 1} to the file to play, which will be used when reporting in
callbacks about e.g. state.
Calling @racket[audio-play!] while another file is still active replaces the
current stream. The worker side interrupts the old decoder, clears the output