audio reference
The audio package: audio.
audio
error Malformed
wolang
offer error Malformederror Unsupported
wolang
offer error Unsupportederror TooLarge
wolang
offer error TooLargeconstant kMaxSamples
wolang
offer const kMaxSamples: int = 134217728constant kPi
wolang
offer const kPi: float = 3.14159265358979class Clip
wolang
offer class Clipfield samples
wolang
var samples: []mut f32field rate
wolang
var rate: int = 48000field channels
wolang
var channels: int = 1method deinit
wolang
deinitmethod Frames
wolang
fun Frames() -> intmethod Seconds
wolang
fun Seconds() -> floatmethod Get
wolang
fun Get(frame: int, channel: int) -> floatmethod Set
wolang
fun Set(frame: int, channel: int, value: float)function ClipNew
wolang
offer fun ClipNew(frames: int, channels: int, rate: int) -> Clip!(Malformed, TooLarge) uses unsafefunction WavDecode
wolang
offer fun WavDecode(data: []u8) -> Clip!(Malformed, Unsupported, TooLarge) uses unsafefunction WavEncode
wolang
offer fun WavEncode(clip: Clip, bits: int) -> []u8!Unsupported uses unsafefunction Resample
wolang
offer fun Resample(clip: Clip, rate: int) -> Clip!(Malformed, TooLarge) uses unsafefunction Remix
wolang
offer fun Remix(clip: Clip, channels: int) -> Clip!(Malformed, TooLarge) uses unsafeclass Voice
wolang
offer class Voicefield clip
wolang
var clip: Clipfield position
wolang
var position: f64 = 0.0field volume
wolang
var volume: float = 1.0field pan
wolang
var pan: float = 0.0field pitch
wolang
var pitch: float = 1.0field looped
wolang
var looped: bool = falsefield bus
wolang
var bus: int = 0field id
wolang
var id: int = 0field done
wolang
var done: bool = falseclass Mixer
wolang
offer class Mixerfield rate
wolang
var rate: intfield channels
wolang
var channels: intfield voices
wolang
var voices: List<Voice>field buses
wolang
var buses: List<float>field master
wolang
var master: float = 1.0field next_id
wolang
var next_id: int = 1method Voices
wolang
fun Voices() -> intmethod Play
wolang
fun Play(clip: Clip, volume: float, pan: float, looped: bool) -> int uses unsafemethod Find
wolang
fun Find(id: int) -> Voice?method IsPlaying
wolang
fun IsPlaying(id: int) -> boolmethod Stop
wolang
fun Stop(id: int)method StopAll
wolang
fun StopAll()method SetVolume
wolang
fun SetVolume(id: int, volume: float)method SetPan
wolang
fun SetPan(id: int, pan: float)method SetPitch
wolang
fun SetPitch(id: int, pitch: float)method SetBus
wolang
fun SetBus(id: int, bus: int)method BusNew
wolang
fun BusNew(gain: float) -> int uses unsafemethod SetBusGain
wolang
fun SetBusGain(bus: int, gain: float)method BusGain
wolang
fun BusGain(bus: int) -> floatmethod SetMaster
wolang
fun SetMaster(gain: float)method Mix
wolang
fun Mix(voice: Voice, out: []mut f32, frames: int) uses unsafemethod Render
wolang
fun Render(out: []mut f32) uses unsafefunction MixerNew
wolang
offer fun MixerNew(rate: int, channels: int) -> Mixer!Malformed uses unsafefunction DeviceAvailable
wolang
offer fun DeviceAvailable() -> bool uses unsafeclass Output
wolang
offer class Outputfield device
wolang
var device: Audiofield mixer
wolang
var mixer: Mixermethod IsOpen
wolang
fun IsOpen() -> boolmethod Pump
wolang
fun Pump() -> int uses unsafemethod Close
wolang
fun Close() uses unsafefunction OutputOpen
wolang
offer fun OutputOpen(rate: int, channels: int) -> Output!Malformed uses unsafeclass VorbisInfo
wolang
offer class VorbisInfofield channels
wolang
var channels: int = 0field rate
wolang
var rate: int = 0field bitrate
wolang
var bitrate: int = 0field frames
wolang
var frames: int = 0field vendor
wolang
var vendor: text = ""field comments
wolang
var comments: List<text>method Seconds
wolang
fun Seconds() -> floatmethod Comment
wolang
fun Comment(key: text) -> text? uses unsafefunction OggVorbisInfo
wolang
offer fun OggVorbisInfo(data: []u8) -> VorbisInfo!(Malformed, Unsupported) uses unsafe