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)
|
||||
(define wav-output-file #f)
|
||||
(define seeked #f)
|
||||
|
||||
(define (audio-play type ao-type handle buf-info buffer buf-len)
|
||||
(let* ((sample (hash-ref buf-info 'sample))
|
||||
@@ -46,6 +47,11 @@
|
||||
(channels (hash-ref buf-info 'channels))
|
||||
(bytes-per-sample-all-channels (* channels bytes-per-sample))
|
||||
(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)
|
||||
(when (eq? ao-h #f)
|
||||
@@ -74,9 +80,7 @@
|
||||
(let* ((buf-size (ao-bufsize-async ao-h))
|
||||
(buf-seconds (exact->inexact (/ buf-size bytes-per-sample-all-channels rate))))
|
||||
(second-printer buf-seconds)
|
||||
(when (= (round current-seconds) 10)
|
||||
(when (= current-file-id 3)
|
||||
(audio-seek current-audio-h 97.0)))
|
||||
(cond-seek)
|
||||
(when (> buf-seconds 5)
|
||||
(letrec ((waiter (λ ()
|
||||
(let ((buf-seconds-left (exact->inexact
|
||||
@@ -98,9 +102,7 @@
|
||||
(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)))
|
||||
(cond-seek)
|
||||
(waiter)))))
|
||||
))
|
||||
(waiter))))
|
||||
|
||||
Reference in New Issue
Block a user