package bogue

  1. Overview
  2. Docs

Basic audio mixer for sound effects

Dependency graph

type t
type repeat =
  1. | Repeat of int
  2. | Forever
val test : unit -> unit
val init : unit -> string option

Initialize SDL audio.

  • returns

    the name of the audio driver.

val create_mixer : ?tracks:int -> ?freq:int -> string option -> t

Create the mixer an open sound device. Only s16le format is supported by the callback at this time.

val load_chunk : t -> string -> sound

Load a WAV file.

val play_chunk : ?track:int -> ?effects:(sound -> unit) list -> ?volume:float -> ?repeat:repeat -> t -> sound -> int option

Play chunk on the desired track number. If track is not specified, find an available track. By default repeat = Repeat 1.

  • returns

    chosen track number, or None

val free_chunk : sound -> unit
val change_volume : float -> sound -> unit

Multiply sound intensity by a float factor

val pause : t -> unit
val unpause : t -> unit
val close : t -> unit
OCaml

Innovation. Community. Security.