45 lines
1.5 KiB
Racket
45 lines
1.5 KiB
Racket
#lang racket/base
|
|
|
|
|
|
(require ffi/unsafe
|
|
ffi/unsafe/define
|
|
"../utils/utils.rkt"
|
|
"libao-ffi.rkt"
|
|
)
|
|
|
|
(provide ao_create_async
|
|
ao_stop_async
|
|
ao_play_async
|
|
ao_is_at_second_async
|
|
ao_music_duration_async
|
|
ao_bufsize_async
|
|
ao_clear_async
|
|
)
|
|
|
|
(define lib (get-lib '("ao-play-async" "libao-play-async") '(#f)))
|
|
(define-ffi-definer define-libao-async lib)
|
|
|
|
(define _libao-async-handle-pointer (_cpointer 'ao-async-handle))
|
|
|
|
;extern void *ao_create_async(void *ao_device, );
|
|
(define-libao-async ao_create_async(_fun _pointer _fpointer -> _libao-async-handle-pointer))
|
|
|
|
;extern void ao_stop_async(void *handle);
|
|
(define-libao-async ao_stop_async(_fun _libao-async-handle-pointer -> _void))
|
|
|
|
;extern void ao_play_async(void *handle, double at_second, double music_duration, int buf_size, void *mem);
|
|
(define-libao-async ao_play_async(_fun _libao-async-handle-pointer _double _double _uint32 _pointer -> _void))
|
|
|
|
;extern double ao_is_at_second_async(void *handle);
|
|
(define-libao-async ao_is_at_second_async(_fun _libao-async-handle-pointer -> _double))
|
|
|
|
;extern double ao_music_duration_async(void *handle);
|
|
(define-libao-async ao_music_duration_async(_fun _libao-async-handle-pointer -> _double))
|
|
|
|
;extern int ao_bufsize_async(void *handle);
|
|
(define-libao-async ao_bufsize_async(_fun _libao-async-handle-pointer -> _int))
|
|
|
|
;extern void ao_clear_async(void *handle);
|
|
(define-libao-async ao_clear_async(_fun _libao-async-handle-pointer -> _void))
|
|
|