audio player with place/threads and channels

This commit is contained in:
2026-05-13 22:50:51 +02:00
parent d298b411a5
commit 3c18e75cf6
6 changed files with 730 additions and 159 deletions
+27
View File
@@ -22,6 +22,10 @@
integer->int-bytes
int-bytes->integer
valid-ffmpeg-versions
make-mutex
mutex-lock
mutex-unlock
with-mutex
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -30,6 +34,29 @@
(sl-def-log racket-sound sound)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Mutex definitions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (make-mutex)
(make-semaphore 1))
(define (mutex-lock m)
(semaphore-wait m))
(define (mutex-unlock m)
(semaphore-post m))
(define-syntax with-mutex
(syntax-rules ()
((_ m b1 ...)
(begin
(semaphore-wait m)
(let ((r (begin b1 ...)))
(semaphore-post m)
r)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Provide some loop constructions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;