-
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
(define kinds (make-hash))
|
(define kinds (make-hash))
|
||||||
(define last-buffer #f)
|
(define last-buffer #f)
|
||||||
(define last-buf-len #f)
|
(define last-buf-len #f)
|
||||||
|
|
||||||
(define (process-frame handle frame buffer)
|
(define (process-frame handle frame buffer)
|
||||||
(let* ((h (flac-ffi-frame-header frame))
|
(let* ((h (flac-ffi-frame-header frame))
|
||||||
(cb-audio (flac-handle-cb-audio handle))
|
(cb-audio (flac-handle-cb-audio handle))
|
||||||
@@ -43,6 +44,7 @@
|
|||||||
(type (hash-ref h 'number-type))
|
(type (hash-ref h 'number-type))
|
||||||
(channels (hash-ref h 'channels))
|
(channels (hash-ref h 'channels))
|
||||||
(block-size (hash-ref h 'blocksize)))
|
(block-size (hash-ref h 'blocksize)))
|
||||||
|
(hash-set! h 'duration (flac-duration handle))
|
||||||
(let ((buffers (ffi 'get-buffers buffer channels block-size)))
|
(let ((buffers (ffi 'get-buffers buffer channels block-size)))
|
||||||
(set! last-buffer buffers)
|
(set! last-buffer buffers)
|
||||||
(set! last-buf-len (hash-ref h 'blocksize))
|
(set! last-buf-len (hash-ref h 'blocksize))
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
[stream-info #:auto #:mutable]
|
[stream-info #:auto #:mutable]
|
||||||
)
|
)
|
||||||
#:auto-value #f
|
#:auto-value #f
|
||||||
|
;#:transparent
|
||||||
)
|
)
|
||||||
|
|
||||||
); end of module
|
); end of module
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
(when (eq? os 'unix)
|
(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 "/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"))
|
||||||
(when (eq? os 'windows)
|
(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")
|
;(set! test-file3 "C:\\Muziek\\Klassiek-Strijkkwartet\\Quatuor Zaïde\\Franz\\01 Erlkönig, D. 328 (Arr. For String Quartet by Eric Mouret).flac")
|
||||||
;(set! test-file3 "C:\\Muziek\\Klassiek-Viool\\Janine Jansen\\Janine Jansen - Sibelius en Prokovief 1 (2024)\\02 - Violin Concerto in D Minor, Op. 47 II. Adagio di molto.flac")
|
(set! test-file3 "C:\\Muziek\\Klassiek-Viool\\Janine Jansen\\Janine Jansen - Sibelius en Prokovief 1 (2024)\\02 - Violin Concerto in D Minor, Op. 47 II. Adagio di molto.flac")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
(bytes-per-sample (/ bits-per-sample 8))
|
(bytes-per-sample (/ bits-per-sample 8))
|
||||||
(channels (hash-ref frame 'channels))
|
(channels (hash-ref frame 'channels))
|
||||||
(bytes-per-sample-all-channels (* channels bytes-per-sample))
|
(bytes-per-sample-all-channels (* channels bytes-per-sample))
|
||||||
|
(duration (hash-ref frame 'duration))
|
||||||
)
|
)
|
||||||
(when (eq? ao-h #f)
|
(when (eq? ao-h #f)
|
||||||
(let ((fmt (ao-mk-format bits-per-sample rate channels 'big-endian)))
|
(let ((fmt (ao-mk-format bits-per-sample rate channels 'big-endian)))
|
||||||
@@ -38,8 +39,14 @@
|
|||||||
(when (> s current-seconds)
|
(when (> s current-seconds)
|
||||||
(set! current-seconds s)
|
(set! current-seconds s)
|
||||||
(let ((minutes (quotient s 60))
|
(let ((minutes (quotient s 60))
|
||||||
(seconds (remainder s 60)))
|
(seconds (remainder s 60))
|
||||||
(displayln (format "At time: ~a:~a" minutes seconds))))))))
|
(tminutes (quotient duration 60))
|
||||||
|
(tseconds (remainder duration 60))
|
||||||
|
)
|
||||||
|
(displayln (format "At time: ~a:~a (~a:~a)"
|
||||||
|
minutes seconds
|
||||||
|
tminutes tseconds
|
||||||
|
))))))))
|
||||||
(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)
|
(second-printer)
|
||||||
|
|||||||
Reference in New Issue
Block a user