From 8182b17096ac4db994db5c077184c847293e2790 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Thu, 16 Apr 2026 09:13:15 +0200 Subject: [PATCH] Make sure libao-1.2.2 is loaded in windows. --- libao-async-ffi.rkt | 5 ++++- play-test.rkt | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libao-async-ffi.rkt b/libao-async-ffi.rkt index 109bcd1..419ab2a 100644 --- a/libao-async-ffi.rkt +++ b/libao-async-ffi.rkt @@ -4,7 +4,7 @@ (require ffi/unsafe ffi/unsafe/define "private/utils.rkt" - "libao-ffi.rkt" + ;"libao-ffi.rkt" ) (provide ao_create_async @@ -48,6 +48,9 @@ )) +(when (eq? (system-type 'os) 'windows) + (void (get-lib '("libao-1.2.2") '(#f)))) + (define lib (get-lib '("ao-play-async" "libao-play-async") '(#f))) ;(define lib (ffi-lib "/home/hans/src/racket/racket-sound-lib/lib/linux-x86_64/libao-play-async.so")) (define-ffi-definer define-libao-async lib diff --git a/play-test.rkt b/play-test.rkt index c29937b..9cbb4f9 100644 --- a/play-test.rkt +++ b/play-test.rkt @@ -7,6 +7,7 @@ ) (define test-file3 #f) +(define test-file3-id 3) (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")) @@ -37,7 +38,7 @@ (when (eq? ao-h #f) (set! ao-h (ao-open-live bits-per-sample rate channels 'big-endian))) ;(displayln 'ao-play) - (ao-play ao-h second duration buffer buf-len 'flac) + (ao-play ao-h test-file3-id second duration buffer buf-len 'flac) ;(displayln 'done) (let ((second-printer (λ (buf-seconds) (let ((s (inexact->exact (round (ao-at-second ao-h)))))