Added volume controle on sample level.

libao-async will adjust the volume of the samples.
This commit is contained in:
2026-04-21 10:10:29 +02:00
parent 8182b17096
commit a7caad7fa4
4 changed files with 39 additions and 5 deletions

View File

@@ -18,6 +18,8 @@
ao-bufsize-async
ao-clear-async
ao-pause
ao-set-volume!
ao-volume
ao-valid?
ao-valid-bits?
ao-valid-rate?
@@ -177,7 +179,20 @@
(ffi:ao_bufsize_async (ao-handle-async-player handle))
)
(define (ao-clear-async handle)
(rc:define/contract (ao-set-volume! handle percentage)
(rc:-> ao-handle? number? void?)
(ffi:ao_set_volume_async (ao-handle-async-player handle)
(if (integer? percentage)
(exact->inexact percentage)
percentage))
)
(rc:define/contract (ao-volume handle)
(rc:-> ao-handle? number?)
(ffi:ao_volume_async (ao-handle-async-player handle))
)
(rc:define/contract (ao-clear-async handle)
(rc:-> ao-handle? void?)
(ffi:ao_clear_async (ao-handle-async-player handle))
)