audio-play! returns the file id.
The file id is now a randomized number
This commit is contained in:
+7
-2
@@ -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?)
|
||||
|
||||
Reference in New Issue
Block a user