for the moment we accept a very small tick with mpg123
This commit is contained in:
+8
-6
@@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
(sl-log-to-display)
|
(sl-log-to-display)
|
||||||
(define wav-output-file #f)
|
(define wav-output-file #f)
|
||||||
|
(define seeked #f)
|
||||||
|
|
||||||
(define (audio-play type ao-type handle buf-info buffer buf-len)
|
(define (audio-play type ao-type handle buf-info buffer buf-len)
|
||||||
(let* ((sample (hash-ref buf-info 'sample))
|
(let* ((sample (hash-ref buf-info 'sample))
|
||||||
@@ -46,6 +47,11 @@
|
|||||||
(channels (hash-ref buf-info 'channels))
|
(channels (hash-ref buf-info 'channels))
|
||||||
(bytes-per-sample-all-channels (* channels bytes-per-sample))
|
(bytes-per-sample-all-channels (* channels bytes-per-sample))
|
||||||
(duration (hash-ref buf-info 'duration))
|
(duration (hash-ref buf-info 'duration))
|
||||||
|
(cond-seek (λ ()
|
||||||
|
(when (= (round current-seconds) 10)
|
||||||
|
(when (and (= current-file-id 3) (not seeked))
|
||||||
|
(set! seeked #t)
|
||||||
|
(audio-seek current-audio-h 97.0)))))
|
||||||
)
|
)
|
||||||
;(displayln buf-info)
|
;(displayln buf-info)
|
||||||
(when (eq? ao-h #f)
|
(when (eq? ao-h #f)
|
||||||
@@ -74,9 +80,7 @@
|
|||||||
(let* ((buf-size (ao-bufsize-async ao-h))
|
(let* ((buf-size (ao-bufsize-async ao-h))
|
||||||
(buf-seconds (exact->inexact (/ buf-size bytes-per-sample-all-channels rate))))
|
(buf-seconds (exact->inexact (/ buf-size bytes-per-sample-all-channels rate))))
|
||||||
(second-printer buf-seconds)
|
(second-printer buf-seconds)
|
||||||
(when (= (round current-seconds) 10)
|
(cond-seek)
|
||||||
(when (= current-file-id 3)
|
|
||||||
(audio-seek current-audio-h 97.0)))
|
|
||||||
(when (> buf-seconds 5)
|
(when (> buf-seconds 5)
|
||||||
(letrec ((waiter (λ ()
|
(letrec ((waiter (λ ()
|
||||||
(let ((buf-seconds-left (exact->inexact
|
(let ((buf-seconds-left (exact->inexact
|
||||||
@@ -98,9 +102,7 @@
|
|||||||
(ao-set-volume! ao-h 150))
|
(ao-set-volume! ao-h 150))
|
||||||
(when (= (round current-seconds) 40)
|
(when (= (round current-seconds) 40)
|
||||||
(ao-set-volume! ao-h 100))
|
(ao-set-volume! ao-h 100))
|
||||||
(when (= (round current-seconds) 10)
|
(cond-seek)
|
||||||
(when (= current-file-id 3)
|
|
||||||
(audio-seek current-audio-h 97.0)))
|
|
||||||
(waiter)))))
|
(waiter)))))
|
||||||
))
|
))
|
||||||
(waiter))))
|
(waiter))))
|
||||||
|
|||||||
Reference in New Issue
Block a user