-
This commit is contained in:
@@ -68,7 +68,7 @@
|
|||||||
(define-libao ao_close (_fun _libao-pointer -> _int))
|
(define-libao ao_close (_fun _libao-pointer -> _int))
|
||||||
|
|
||||||
; void ao_shutdown();
|
; void ao_shutdown();
|
||||||
(define-libao ao_shutdown (_fun -> _int))
|
(define-libao ao_shutdown (_fun -> _void))
|
||||||
|
|
||||||
; int ao_append_option(ao_option **options, const char *key, const char *value);
|
; int ao_append_option(ao_option **options, const char *key, const char *value);
|
||||||
(define-libao ao_append_option (_fun _pointer _pointer _pointer -> _int))
|
(define-libao ao_append_option (_fun _pointer _pointer _pointer -> _int))
|
||||||
|
|||||||
@@ -402,7 +402,7 @@
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(define _FLAC__StreamDecoder-pointer (_cpointer 'flac-streamdecoder))
|
(define _FLAC__StreamDecoder-pointer (_cpointer 'flac-streamdecoder))
|
||||||
(define _FLAC__Data-pointer (_cpointer 'flac-client-data))
|
(define _FLAC__Data-pointer (_cpointer/null 'flac-client-data))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; FLAC Callback function definitions
|
;; FLAC Callback function definitions
|
||||||
@@ -414,18 +414,21 @@
|
|||||||
(_fun _FLAC__StreamDecoder-pointer
|
(_fun _FLAC__StreamDecoder-pointer
|
||||||
_FLAC__Frame-pointer
|
_FLAC__Frame-pointer
|
||||||
FLAC__int32**
|
FLAC__int32**
|
||||||
_FLAC__Data-pointer -> _int))
|
_FLAC__Data-pointer
|
||||||
|
-> _int))
|
||||||
|
|
||||||
;typedef void(* FLAC__StreamDecoderMetadataCallback) (const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
|
;typedef void(* FLAC__StreamDecoderMetadataCallback) (const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
|
||||||
(define _FLAC__StreamDecoderMetadataCallback
|
(define _FLAC__StreamDecoderMetadataCallback
|
||||||
(_fun _FLAC__StreamDecoder-pointer
|
(_fun _FLAC__StreamDecoder-pointer
|
||||||
_FLAC__StreamMetadata-pointer
|
_FLAC__StreamMetadata-pointer
|
||||||
_FLAC__Data-pointer -> _void))
|
_FLAC__Data-pointer
|
||||||
|
-> _void))
|
||||||
|
|
||||||
(define _FLAC__StreamDecoderErrorCallback
|
(define _FLAC__StreamDecoderErrorCallback
|
||||||
(_fun _FLAC__StreamDecoder-pointer
|
(_fun _FLAC__StreamDecoder-pointer
|
||||||
_int
|
_int
|
||||||
_FLAC__Data-pointer -> _void))
|
_FLAC__Data-pointer
|
||||||
|
-> _void))
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
@@ -464,6 +467,7 @@
|
|||||||
_FLAC__StreamDecoderWriteCallback
|
_FLAC__StreamDecoderWriteCallback
|
||||||
_FLAC__StreamDecoderMetadataCallback
|
_FLAC__StreamDecoderMetadataCallback
|
||||||
_FLAC__StreamDecoderErrorCallback
|
_FLAC__StreamDecoderErrorCallback
|
||||||
|
_FLAC__Data-pointer ; Seen by Jens Axel Søgaard - Is already present in FLAC 1.4.3
|
||||||
-> _int))
|
-> _int))
|
||||||
|
|
||||||
(define-libflac FLAC__stream_decoder_process_single
|
(define-libflac FLAC__stream_decoder_process_single
|
||||||
@@ -488,15 +492,16 @@
|
|||||||
(define error-no -1)
|
(define error-no -1)
|
||||||
(define fl #f)
|
(define fl #f)
|
||||||
(define flac-file #f)
|
(define flac-file #f)
|
||||||
|
(define client-data #f)
|
||||||
|
|
||||||
(define (write-callback fl frame buffer data)
|
(define (write-callback fl frame buffer client-data)
|
||||||
(set! write-data (append write-data (list (cons frame buffer))))
|
(set! write-data (append write-data (list (cons frame buffer))))
|
||||||
0)
|
0)
|
||||||
|
|
||||||
(define (meta-callback fl meta data)
|
(define (meta-callback fl meta client-data)
|
||||||
(set! meta-data (append meta-data (list meta))))
|
(set! meta-data (append meta-data (list meta))))
|
||||||
|
|
||||||
(define (error-callback fl errno data)
|
(define (error-callback fl errno client-data)
|
||||||
(set! error-no errno)
|
(set! error-no errno)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -506,11 +511,12 @@
|
|||||||
|
|
||||||
(define (init file)
|
(define (init file)
|
||||||
(let ((r (FLAC__stream_decoder_init_file
|
(let ((r (FLAC__stream_decoder_init_file
|
||||||
fl
|
fl
|
||||||
file
|
file
|
||||||
write-callback
|
write-callback
|
||||||
meta-callback
|
meta-callback
|
||||||
error-callback)))
|
error-callback
|
||||||
|
client-data)))
|
||||||
(set! flac-file file)
|
(set! flac-file file)
|
||||||
r))
|
r))
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(ao-set-async-mode! 'scheme)
|
||||||
;(define fmt (ao-mk-format 24 48000 2 'big-endian))
|
;(define fmt (ao-mk-format 24 48000 2 'big-endian))
|
||||||
;(define ao-h (ao-open-live #f fmt))
|
;(define ao-h (ao-open-live #f fmt))
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
(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)))
|
||||||
(set! ao-h (ao-open-live #f fmt))))
|
(set! ao-h (ao-open-live #f fmt))))
|
||||||
(ao-play ao-h second buffer)
|
(ao-play ao-h second duration buffer)
|
||||||
(let ((second-printer (λ ()
|
(let ((second-printer (λ ()
|
||||||
(let ((s (inexact->exact (round (ao-at-second ao-h)))))
|
(let ((s (inexact->exact (round (ao-at-second ao-h)))))
|
||||||
(unless (= s current-seconds)
|
(unless (= s current-seconds)
|
||||||
|
|||||||
Reference in New Issue
Block a user