standard audio pipeline
This commit is contained in:
+19
-7
@@ -9,11 +9,14 @@
|
||||
)
|
||||
|
||||
(define test-file3 #f)
|
||||
(define test-file4 #f)
|
||||
(define test-file3-id 3)
|
||||
(define test-file4-id 4)
|
||||
(let ((os (system-type 'os)))
|
||||
(when (eq? os 'unix)
|
||||
;(set! test-file3 "/muziek/Klassiek-Viool/Alina Ibragimova/Paganini_24 Caprices (2021)/24. 24 Caprices, Op 1 - No. 24 in A minor- Tema con variazioni. Quasi presto.flac")
|
||||
(set! test-file3 "/tmp/test.mp3")
|
||||
(set! test-file4 "/tmp/test1.mp3")
|
||||
)
|
||||
(when (eq? os 'windows)
|
||||
(set! test-file3 "C:\\Muziek\\Klassiek-Strijkkwartet\\Quatuor Zaïde\\Franz\\01 Erlkönig, D. 328 (Arr. For String Quartet by Eric Mouret).flac")
|
||||
@@ -26,6 +29,8 @@
|
||||
|
||||
(define current-seconds 0)
|
||||
(define ao-h #f)
|
||||
(define current-file-id -1)
|
||||
(define current-audio-h #f)
|
||||
|
||||
(sl-log-to-display)
|
||||
|
||||
@@ -43,7 +48,7 @@
|
||||
(when (eq? ao-h #f)
|
||||
(set! ao-h (ao-open-live bits-per-sample rate channels 'native-endian)))
|
||||
;(displayln 'ao-play)
|
||||
(ao-play ao-h test-file3-id second duration buffer buf-len ao-type)
|
||||
(ao-play ao-h current-file-id second duration buffer buf-len ao-type)
|
||||
(set! duration (inexact->exact (round duration)))
|
||||
;(displayln 'done)
|
||||
(let ((second-printer (λ (buf-seconds)
|
||||
@@ -87,6 +92,9 @@
|
||||
(ao-set-volume! ao-h 150))
|
||||
(when (= (round current-seconds) 40)
|
||||
(ao-set-volume! ao-h 100))
|
||||
(when (= (round current-seconds) 10)
|
||||
(when (= current-file-id 3)
|
||||
(audio-seek current-audio-h 97.0)))
|
||||
(waiter)))))
|
||||
))
|
||||
(waiter))))
|
||||
@@ -102,13 +110,17 @@
|
||||
(define (play)
|
||||
(set! ao-h #f)
|
||||
(let ((audio-h (audio-open test-file3 audio-meta audio-play)))
|
||||
(set! current-file-id test-file3-id)
|
||||
(set! current-audio-h audio-h)
|
||||
(audio-read audio-h)
|
||||
(ao-close ao-h)
|
||||
(set! ao-h #f)))
|
||||
;(sleep 1.0)
|
||||
;(play)))
|
||||
|
||||
;(flac-read flac-h)
|
||||
)
|
||||
(let ((audio-h (audio-open test-file4 audio-meta audio-play)))
|
||||
(set! current-file-id test-file4-id)
|
||||
(set! current-audio-h audio-h)
|
||||
(audio-read audio-h)
|
||||
)
|
||||
(ao-close ao-h)
|
||||
(set! ao-h #f))
|
||||
|
||||
(play)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user