moonbit-community/moon_cpal/core does not have a README file

    ChannelCount

    type ChannelCount = Int

    FrameCount

    type FrameCount = Int

    SampleRate

    type SampleRate = Int

    FromSample

    pub trait FromSample : Sample {
    fn from_sample(Float) -> Self
    }

    impl FromSample for Byte
    impl FromSample for Int16
    impl FromSample for Float

    Sample

    pub trait Sample {
    fn equilibrium() -> Self
    fn to_f32(Self) -> Float
    fn from_f32(Float) -> Self
    }

    impl Sample for Byte
    impl Sample for Int16
    impl Sample for UInt16
    impl Sample for Float
    impl Sample for Double

    SizedSample

    pub trait SizedSample : Sample {
    fn format(Self) -> SampleFormat
    }

    impl SizedSample for Byte

    BuildStreamError

    pub suberror BuildStreamError {
    DeviceNotAvailable
    DeviceBusy
    StreamConfigNotSupported
    InvalidArgument
    StreamIdOverflow
    BackendSpecific(BackendSpecificError)
    } derive(Eq,
    Debug
    )

    Error that can happen when creating a stream.

    BuildStreamError::equal

    BuildStreamError::not_equal

    fn BuildStreamError::not_equal(x : BuildStreamError, y : BuildStreamError) -> Bool

    BuildStreamError::output

    fn BuildStreamError::output(self : BuildStreamError, logger : &Logger) -> Unit

    BuildStreamError::to_string

    fn BuildStreamError::to_string(self : BuildStreamError) -> String

    DefaultStreamConfigError

    pub suberror DefaultStreamConfigError {
    DeviceNotAvailable
    DeviceBusy
    StreamTypeNotSupported
    BackendSpecific(BackendSpecificError)
    } derive(Eq,
    Debug
    )

    May occur when attempting to request the default input or output stream config from a device.

    DefaultStreamConfigError::equal

    DefaultStreamConfigError::not_equal

    DefaultStreamConfigError::output

    fn DefaultStreamConfigError::output(self : DefaultStreamConfigError, logger : &Logger) -> Unit

    DefaultStreamConfigError::to_string

    fn DefaultStreamConfigError::to_string(self : DefaultStreamConfigError) -> String

    DeviceIdError

    pub suberror DeviceIdError {
    UnsupportedPlatform
    BackendSpecific(BackendSpecificError)
    } derive(Eq,
    Debug
    )

    DeviceIdError::equal

    DeviceIdError::not_equal

    fn DeviceIdError::not_equal(x : DeviceIdError, y : DeviceIdError) -> Bool

    DeviceIdError::output

    fn DeviceIdError::output(self : DeviceIdError, logger : &Logger) -> Unit

    DeviceIdError::to_string

    fn DeviceIdError::to_string(self : DeviceIdError) -> String

    DeviceNameError

    pub suberror DeviceNameError {
    BackendSpecific(BackendSpecificError)
    } derive(Eq,
    Debug
    )

    An error that may occur while attempting to retrieve a device name.

    DeviceNameError::equal

    DeviceNameError::not_equal

    fn DeviceNameError::not_equal(x : DeviceNameError, y : DeviceNameError) -> Bool

    DeviceNameError::output

    fn DeviceNameError::output(self : DeviceNameError, logger : &Logger) -> Unit

    DeviceNameError::to_string

    fn DeviceNameError::to_string(self : DeviceNameError) -> String

    DevicesError

    pub suberror DevicesError {
    BackendSpecific(BackendSpecificError)
    } derive(Eq,
    Debug
    )

    An error that might occur while attempting to enumerate devices.

    DevicesError::equal

    DevicesError::not_equal

    fn DevicesError::not_equal(x : DevicesError, y : DevicesError) -> Bool

    DevicesError::output

    fn DevicesError::output(self : DevicesError, logger : &Logger) -> Unit

    DevicesError::to_string

    fn DevicesError::to_string(self : DevicesError) -> String

    HostUnavailable

    pub suberror HostUnavailable {
    HostUnavailable
    } derive(Eq,
    Debug
    )

    HostUnavailable::equal

    HostUnavailable::not_equal

    fn HostUnavailable::not_equal(x : HostUnavailable, y : HostUnavailable) -> Bool

    HostUnavailable::output

    fn HostUnavailable::output(self : HostUnavailable, logger : &Logger) -> Unit

    HostUnavailable::to_string

    fn HostUnavailable::to_string(self : HostUnavailable) -> String

    PauseStreamError

    pub suberror PauseStreamError {
    DeviceNotAvailable
    BackendSpecific(BackendSpecificError)
    } derive(Eq,
    Debug
    )

    PauseStreamError::equal

    PauseStreamError::not_equal

    fn PauseStreamError::not_equal(x : PauseStreamError, y : PauseStreamError) -> Bool

    PauseStreamError::output

    fn PauseStreamError::output(self : PauseStreamError, logger : &Logger) -> Unit

    PauseStreamError::to_string

    fn PauseStreamError::to_string(self : PauseStreamError) -> String

    PlayStreamError

    pub suberror PlayStreamError {
    DeviceNotAvailable
    BackendSpecific(BackendSpecificError)
    } derive(Eq,
    Debug
    )

    PlayStreamError::equal

    PlayStreamError::not_equal

    fn PlayStreamError::not_equal(x : PlayStreamError, y : PlayStreamError) -> Bool

    PlayStreamError::output

    fn PlayStreamError::output(self : PlayStreamError, logger : &Logger) -> Unit

    PlayStreamError::to_string

    fn PlayStreamError::to_string(self : PlayStreamError) -> String

    StreamError

    pub suberror StreamError {
    DeviceNotAvailable
    StreamInvalidated
    BufferUnderrun
    BackendSpecific(BackendSpecificError)
    } derive(Eq,
    Debug
    )

    impl Show for StreamError

    StreamError::equal

    fn StreamError::equal(StreamError, StreamError) -> Bool

    StreamError::not_equal

    fn StreamError::not_equal(x : StreamError, y : StreamError) -> Bool

    StreamError::output

    fn StreamError::output(self : StreamError, logger : &Logger) -> Unit

    StreamError::to_string

    fn StreamError::to_string(self : StreamError) -> String

    SupportedStreamConfigsError

    pub suberror SupportedStreamConfigsError {
    DeviceNotAvailable
    DeviceBusy
    InvalidArgument
    BackendSpecific(BackendSpecificError)
    } derive(Eq,
    Debug
    )

    Error that can happen when enumerating the list of supported configs.

    SupportedStreamConfigsError::not_equal

    SupportedStreamConfigsError::output

    fn SupportedStreamConfigsError::output(self : SupportedStreamConfigsError, logger : &Logger) -> Unit

    SupportedStreamConfigsError::to_string

    BackendSpecificError

    pub struct BackendSpecificError {
    description : String
    } derive(Eq,
    Debug
    )

    BackendSpecificError::BackendSpecificError

    fn BackendSpecificError::BackendSpecificError(description : String) -> BackendSpecificError

    BackendSpecificError::description

    fn BackendSpecificError::description(self : BackendSpecificError) -> String

    BackendSpecificError::equal

    BackendSpecificError::new

    fn BackendSpecificError::new(description : String) -> BackendSpecificError

    BackendSpecificError::not_equal

    BackendSpecificError::output

    fn BackendSpecificError::output(self : BackendSpecificError, logger : &Logger) -> Unit

    BackendSpecificError::to_string

    fn BackendSpecificError::to_string(self : BackendSpecificError) -> String

    BufferSize

    pub enum BufferSize {
    Default
    Fixed(Int)
    } derive(Eq,
    Debug
    )

    The buffer size requests the callback size for audio streams.

    Mirrors upstream cpal::BufferSize:
    • Default uses the host's default callback size.
    • Fixed(n) requests approximately n frames per callback.

    The actual callback size depends on the backend/host implementation and may differ from or vary around the requested size.
    impl Show for BufferSize

    BufferSize::default

    fn BufferSize::default() -> BufferSize

    BufferSize::equal

    fn BufferSize::equal(BufferSize, BufferSize) -> Bool

    BufferSize::fixed

    fn BufferSize::fixed(n : Int) -> BufferSize

    BufferSize::not_equal

    fn BufferSize::not_equal(x : BufferSize, y : BufferSize) -> Bool

    BufferSize::output

    fn BufferSize::output(self : BufferSize, logger : &Logger) -> Unit

    BufferSize::to_string

    fn BufferSize::to_string(self : BufferSize) -> String

    Data

    pub struct Data {
    sample_format : SampleFormat
    bytes : FixedArray[Byte]
    } derive(Eq,
    Debug
    )

    impl Show for Data

    Data::Data

    fn Data::Data(sample_format : SampleFormat, bytes : FixedArray[Byte]) -> Data

    Data::bytes

    fn Data::bytes(self : Data) -> FixedArray[Byte]

    Data::clear

    fn Data::clear(self : Data) -> Unit

    Fill the underlying buffer with the sample-format equilibrium value (silence).

    Data::equal

    fn Data::equal(Data, Data) -> Bool

    Data::len

    fn Data::len(self : Data) -> Int

    Number of samples in the buffer (floor if the byte length is not aligned to the sample size).

    Data::new

    fn Data::new(sample_format : SampleFormat, bytes : FixedArray[Byte]) -> Data

    Data::not_equal

    fn Data::not_equal(x : Data, y : Data) -> Bool

    Data::output

    fn Data::output(self : Data, logger : &Logger) -> Unit

    Data::sample_format

    fn Data::sample_format(self : Data) -> SampleFormat

    Data::to_repr

    Data::to_string

    fn Data::to_string(self : Data) -> String

    Data::try_as_f32

    fn Data::try_as_f32(self : Data) -> Array[Float]?

    Data::try_as_f64

    fn Data::try_as_f64(self : Data) -> Array[Double]?

    Data::try_as_i16

    fn Data::try_as_i16(self : Data) -> Array[Int16]?

    Data::try_as_i24

    fn Data::try_as_i24(self : Data) -> Array[I24]?

    Data::try_as_i32

    fn Data::try_as_i32(self : Data) -> Array[Int]?

    Data::try_as_i64

    fn Data::try_as_i64(self : Data) -> Array[Int64]?

    Data::try_as_i8

    fn Data::try_as_i8(self : Data) -> Array[Int]?

    Data::try_as_u16

    fn Data::try_as_u16(self : Data) -> Array[UInt16]?

    Data::try_as_u24

    fn Data::try_as_u24(self : Data) -> Array[U24]?

    Data::try_as_u32

    fn Data::try_as_u32(self : Data) -> Array[UInt]?

    Data::try_as_u64

    fn Data::try_as_u64(self : Data) -> Array[UInt64]?

    Data::try_as_u8

    fn Data::try_as_u8(self : Data) -> Array[Byte]?

    Data::write_f32

    fn Data::write_f32(self : Data, samples : Array[Float]) -> Bool

    Best-effort encoder for F32 (IEEE-754, little-endian) output buffers.

    Data::write_f64

    fn Data::write_f64(self : Data, samples : Array[Double]) -> Bool

    Best-effort encoder for F64 (IEEE-754, little-endian).

    Data::write_i16

    fn Data::write_i16(self : Data, samples : Array[Int16]) -> Bool

    Best-effort encoder for I16 (little-endian) output buffers.

    Data::write_i24

    fn Data::write_i24(self : Data, samples : Array[I24]) -> Bool

    Best-effort encoder for I24 (little-endian, stored in the low 24 bits of a 32-bit word).

    Data::write_i32

    fn Data::write_i32(self : Data, samples : Array[Int]) -> Bool

    Best-effort encoder for I32 (little-endian).

    Data::write_i64

    fn Data::write_i64(self : Data, samples : Array[Int64]) -> Bool

    Best-effort encoder for I64 (little-endian).

    Data::write_i8

    fn Data::write_i8(self : Data, samples : Array[Int]) -> Bool

    Best-effort encoder for I8 output buffers.

    Data::write_u16

    fn Data::write_u16(self : Data, samples : Array[UInt16]) -> Bool

    Best-effort encoder for U16 (little-endian) output buffers.

    Data::write_u24

    fn Data::write_u24(self : Data, samples : Array[U24]) -> Bool

    Best-effort encoder for U24 (little-endian, stored in the low 24 bits of a 32-bit word).

    Data::write_u32

    fn Data::write_u32(self : Data, samples : Array[UInt]) -> Bool

    Best-effort encoder for U32 (little-endian).

    Data::write_u64

    fn Data::write_u64(self : Data, samples : Array[UInt64]) -> Bool

    Best-effort encoder for U64 (little-endian).

    Data::write_u8

    fn Data::write_u8(self : Data, samples : Array[Byte]) -> Bool

    Best-effort encoder for U8 output buffers.

    DeviceDescription

    pub struct DeviceDescription {
    name : String
    manufacturer : String?
    driver : String?
    device_type : DeviceType
    interface_type : InterfaceType
    direction : DeviceDirection
    address : String?
    extended : Array[String]
    } derive(Eq,
    Debug
    )

    DeviceDescription::DeviceDescription

    fn DeviceDescription::DeviceDescription(name : String, manufacturer? : String?, driver? : String?, device_type? : DeviceType, interface_type? : InterfaceType, direction? : DeviceDirection, address? : String?, extended? : Array[String]) -> DeviceDescription

    DeviceDescription::address

    fn DeviceDescription::address(self : DeviceDescription) -> String?

    DeviceDescription::device_type

    DeviceDescription::direction

    DeviceDescription::driver

    fn DeviceDescription::driver(self : DeviceDescription) -> String?

    DeviceDescription::equal

    DeviceDescription::extended

    fn DeviceDescription::extended(self : DeviceDescription) -> Array[String]

    DeviceDescription::interface_type

    fn DeviceDescription::interface_type(self : DeviceDescription) -> InterfaceType

    DeviceDescription::manufacturer

    fn DeviceDescription::manufacturer(self : DeviceDescription) -> String?

    DeviceDescription::name

    fn DeviceDescription::name(self : DeviceDescription) -> String

    DeviceDescription::new

    fn DeviceDescription::new(name : String, manufacturer? : String?, driver? : String?, device_type? : DeviceType, interface_type? : InterfaceType, direction? : DeviceDirection, address? : String?, extended? : Array[String]) -> DeviceDescription

    DeviceDescription::not_equal

    fn DeviceDescription::not_equal(x : DeviceDescription, y : DeviceDescription) -> Bool

    DeviceDescription::output

    fn DeviceDescription::output(self : DeviceDescription, logger : &Logger) -> Unit

    DeviceDescription::supports_input

    fn DeviceDescription::supports_input(self : DeviceDescription) -> Bool

    DeviceDescription::supports_output

    fn DeviceDescription::supports_output(self : DeviceDescription) -> Bool

    DeviceDescription::to_string

    fn DeviceDescription::to_string(self : DeviceDescription) -> String

    DeviceDescriptionBuilder

    pub struct DeviceDescriptionBuilder {
    name : String
    manufacturer : String?
    driver : String?
    device_type : DeviceType
    interface_type : InterfaceType
    direction : DeviceDirection
    address : String?
    extended : Array[String]
    } derive(Eq,
    Debug
    )

    Builder for constructing a DeviceDescription.

    This is primarily intended for backend implementations to gradually build up descriptions with whatever metadata is available.

    DeviceDescriptionBuilder::DeviceDescriptionBuilder

    fn DeviceDescriptionBuilder::DeviceDescriptionBuilder(name : String) -> DeviceDescriptionBuilder

    DeviceDescriptionBuilder::add_extended_line

    fn DeviceDescriptionBuilder::add_extended_line(self : DeviceDescriptionBuilder, line : String) -> DeviceDescriptionBuilder

    DeviceDescriptionBuilder::address

    DeviceDescriptionBuilder::build

    DeviceDescriptionBuilder::device_type

    DeviceDescriptionBuilder::direction

    DeviceDescriptionBuilder::driver

    DeviceDescriptionBuilder::equal

    DeviceDescriptionBuilder::extended

    DeviceDescriptionBuilder::interface_type

    DeviceDescriptionBuilder::manufacturer

    fn DeviceDescriptionBuilder::manufacturer(self : DeviceDescriptionBuilder, manufacturer : String) -> DeviceDescriptionBuilder

    DeviceDescriptionBuilder::new

    DeviceDescriptionBuilder::not_equal

    DeviceDescriptionBuilder::output

    fn DeviceDescriptionBuilder::output(self : DeviceDescriptionBuilder, logger : &Logger) -> Unit

    DeviceDescriptionBuilder::to_string

    fn DeviceDescriptionBuilder::to_string(self : DeviceDescriptionBuilder) -> String

    DeviceDirection

    pub enum DeviceDirection {
    Input
    Output
    Duplex
    Unknown
    } derive(Eq,
    Debug
    )

    DeviceDirection::duplex

    DeviceDirection::equal

    DeviceDirection::input

    DeviceDirection::not_equal

    fn DeviceDirection::not_equal(x : DeviceDirection, y : DeviceDirection) -> Bool

    DeviceDirection::output

    DeviceDirection::to_string

    fn DeviceDirection::to_string(self : DeviceDirection) -> String

    DeviceDirection::unknown

    DeviceId

    pub struct DeviceId {
    host_id : HostId
    device_id : String
    } derive(Eq,
    Debug
    )

    impl Show for DeviceId

    DeviceId::DeviceId

    fn DeviceId::DeviceId(host_id : HostId, device_id : String) -> DeviceId

    DeviceId::device_id

    fn DeviceId::device_id(self : DeviceId) -> String

    DeviceId::equal

    fn DeviceId::equal(DeviceId, DeviceId) -> Bool

    DeviceId::from_string

    fn DeviceId::from_string(s : String) -> DeviceId raise DeviceIdError

    DeviceId::host_id

    fn DeviceId::host_id(self : DeviceId) -> HostId

    DeviceId::new

    fn DeviceId::new(host_id : HostId, device_id : String) -> DeviceId

    DeviceId::not_equal

    fn DeviceId::not_equal(x : DeviceId, y : DeviceId) -> Bool

    DeviceId::output

    fn DeviceId::output(self : DeviceId, logger : &Logger) -> Unit

    DeviceId::to_repr

    DeviceId::to_string

    fn DeviceId::to_string(self : DeviceId) -> String

    DeviceType

    pub enum DeviceType {
    Speaker
    Microphone
    Headphones
    Headset
    Earpiece
    Handset
    HearingAid
    Dock
    Tuner
    Virtual
    Unknown
    } derive(Eq,
    Debug
    )

    impl Show for DeviceType

    DeviceType::dock

    fn DeviceType::dock() -> DeviceType

    DeviceType::earpiece

    fn DeviceType::earpiece() -> DeviceType

    DeviceType::equal

    fn DeviceType::equal(DeviceType, DeviceType) -> Bool

    DeviceType::handset

    fn DeviceType::handset() -> DeviceType

    DeviceType::headphones

    fn DeviceType::headphones() -> DeviceType

    DeviceType::headset

    fn DeviceType::headset() -> DeviceType

    DeviceType::hearing_aid

    fn DeviceType::hearing_aid() -> DeviceType

    DeviceType::microphone

    fn DeviceType::microphone() -> DeviceType

    DeviceType::not_equal

    fn DeviceType::not_equal(x : DeviceType, y : DeviceType) -> Bool

    DeviceType::output

    fn DeviceType::output(self : DeviceType, logger : &Logger) -> Unit

    DeviceType::speaker

    fn DeviceType::speaker() -> DeviceType

    DeviceType::to_string

    fn DeviceType::to_string(self : DeviceType) -> String

    DeviceType::tuner

    fn DeviceType::tuner() -> DeviceType

    DeviceType::unknown

    fn DeviceType::unknown() -> DeviceType

    DeviceType::virtual_

    fn DeviceType::virtual_() -> DeviceType

    Duration

    pub struct Duration {
    secs : UInt64
    nanos : Int
    } derive(Eq,
    Debug
    )

    A minimal duration type used by the ported StreamInstant arithmetic.

    Upstream uses std::time::Duration (non-negative). Here we keep the same invariant.
    impl Show for Duration

    Duration::Duration

    fn Duration::Duration(secs : UInt64, nanos : Int) -> Duration

    Duration::equal

    fn Duration::equal(Duration, Duration) -> Bool

    Duration::from_secs

    fn Duration::from_secs(secs : UInt64) -> Duration

    Duration::new

    fn Duration::new(secs : UInt64, nanos : Int) -> Duration

    Duration::not_equal

    fn Duration::not_equal(x : Duration, y : Duration) -> Bool

    Duration::output

    fn Duration::output(self : Duration, logger : &Logger) -> Unit

    Duration::to_repr

    Duration::to_string

    fn Duration::to_string(self : Duration) -> String

    HostId

    pub(all) enum HostId {
    AAudio
    Alsa
    Asio
    CoreAudio
    Custom
    Emscripten
    Jack
    Null
    Wasapi
    WebAudio
    AudioWorklet
    } derive(Eq,
    Debug
    )

    impl Show for HostId

    HostId::equal

    fn HostId::equal(HostId, HostId) -> Bool

    HostId::from_string

    fn HostId::from_string(s : String) -> HostId?

    HostId::from_view

    fn HostId::from_view(v : StringView) -> HostId?

    HostId::name

    fn HostId::name(self : HostId) -> String

    Upstream HostId::name() returns the variant name (before lowercase display).

    HostId::not_equal

    fn HostId::not_equal(x : HostId, y : HostId) -> Bool

    HostId::output

    fn HostId::output(self : HostId, logger : &Logger) -> Unit

    HostId::parse

    fn HostId::parse(s : String) -> HostId raise HostUnavailable

    HostId::to_repr

    HostId::to_string

    fn HostId::to_string(self : HostId) -> String

    I24

    pub struct I24 {
    raw : Int
    } derive(Eq,
    Debug
    )

    impl FromSample for I24
    impl Sample for I24
    impl SizedSample for I24
    impl Show for I24

    I24::I24

    fn I24::I24(raw : Int) -> I24

    I24::equal

    fn I24::equal(I24, I24) -> Bool

    I24::equilibrium

    fn I24::equilibrium() -> I24

    I24::format

    fn I24::format(_self : I24) -> SampleFormat

    I24::from_f32

    fn I24::from_f32(x : Float) -> I24

    I24::from_sample

    fn I24::from_sample(x : Float) -> I24

    I24::new

    fn I24::new(raw : Int) -> I24

    I24::not_equal

    fn I24::not_equal(x : I24, y : I24) -> Bool

    I24::output

    fn I24::output(self : I24, logger : &Logger) -> Unit

    I24::to_f32

    fn I24::to_f32(self : I24) -> Float

    I24::to_int

    fn I24::to_int(self : I24) -> Int

    I24::to_repr

    I24::to_string

    fn I24::to_string(self : I24) -> String

    InputCallbackInfo

    pub struct InputCallbackInfo {
    timestamp : InputStreamTimestamp
    } derive(Eq,
    Debug
    )

    Information relevant to a single call to the user's input stream data callback.

    InputCallbackInfo::InputCallbackInfo

    fn InputCallbackInfo::InputCallbackInfo(timestamp : InputStreamTimestamp) -> InputCallbackInfo

    InputCallbackInfo::equal

    InputCallbackInfo::new

    InputCallbackInfo::not_equal

    fn InputCallbackInfo::not_equal(x : InputCallbackInfo, y : InputCallbackInfo) -> Bool

    InputCallbackInfo::output

    fn InputCallbackInfo::output(self : InputCallbackInfo, logger : &Logger) -> Unit

    InputCallbackInfo::timestamp

    InputCallbackInfo::to_string

    fn InputCallbackInfo::to_string(self : InputCallbackInfo) -> String

    InputStreamTimestamp

    pub struct InputStreamTimestamp {
    callback : StreamInstant
    capture : StreamInstant
    } derive(Eq,
    Debug
    )

    A timestamp associated with a call to an input stream's data callback.

    InputStreamTimestamp::InputStreamTimestamp

    fn InputStreamTimestamp::InputStreamTimestamp(callback : StreamInstant, capture : StreamInstant) -> InputStreamTimestamp

    InputStreamTimestamp::callback

    InputStreamTimestamp::capture

    InputStreamTimestamp::equal

    InputStreamTimestamp::new

    InputStreamTimestamp::not_equal

    InputStreamTimestamp::output

    fn InputStreamTimestamp::output(self : InputStreamTimestamp, logger : &Logger) -> Unit

    InputStreamTimestamp::to_string

    fn InputStreamTimestamp::to_string(self : InputStreamTimestamp) -> String

    InterfaceType

    pub enum InterfaceType {
    BuiltIn
    Usb
    Bluetooth
    Pci
    FireWire
    Thunderbolt
    Hdmi
    Line
    Spdif
    Network
    Virtual
    DisplayPort
    Aggregate
    Unknown
    } derive(Eq,
    Debug
    )

    InterfaceType::aggregate

    fn InterfaceType::aggregate() -> InterfaceType

    InterfaceType::bluetooth

    fn InterfaceType::bluetooth() -> InterfaceType

    InterfaceType::built_in

    fn InterfaceType::built_in() -> InterfaceType

    InterfaceType::display_port

    fn InterfaceType::display_port() -> InterfaceType

    InterfaceType::equal

    InterfaceType::fire_wire

    fn InterfaceType::fire_wire() -> InterfaceType

    InterfaceType::hdmi

    InterfaceType::line

    InterfaceType::network

    fn InterfaceType::network() -> InterfaceType

    InterfaceType::not_equal

    fn InterfaceType::not_equal(x : InterfaceType, y : InterfaceType) -> Bool

    InterfaceType::output

    fn InterfaceType::output(self : InterfaceType, logger : &Logger) -> Unit

    InterfaceType::pci

    InterfaceType::spdif

    InterfaceType::thunderbolt

    fn InterfaceType::thunderbolt() -> InterfaceType

    InterfaceType::to_string

    fn InterfaceType::to_string(self : InterfaceType) -> String

    InterfaceType::unknown

    fn InterfaceType::unknown() -> InterfaceType

    InterfaceType::usb

    InterfaceType::virtual_

    fn InterfaceType::virtual_() -> InterfaceType

    NativeOs

    pub(all) enum NativeOs {
    Unknown
    Macos
    Windows
    Linux
    } derive(Eq,
    Debug
    )

    impl Show for NativeOs

    NativeOs::equal

    fn NativeOs::equal(NativeOs, NativeOs) -> Bool

    NativeOs::not_equal

    fn NativeOs::not_equal(x : NativeOs, y : NativeOs) -> Bool

    NativeOs::output

    fn NativeOs::output(self : NativeOs, logger : &Logger) -> Unit

    NativeOs::to_repr

    NativeOs::to_string

    fn NativeOs::to_string(self : NativeOs) -> String

    OutputCallbackInfo

    pub struct OutputCallbackInfo {
    timestamp : OutputStreamTimestamp
    } derive(Eq,
    Debug
    )

    Information relevant to a single call to the user's output stream data callback.

    OutputCallbackInfo::OutputCallbackInfo

    fn OutputCallbackInfo::OutputCallbackInfo(timestamp : OutputStreamTimestamp) -> OutputCallbackInfo

    OutputCallbackInfo::equal

    OutputCallbackInfo::new

    OutputCallbackInfo::not_equal

    OutputCallbackInfo::output

    fn OutputCallbackInfo::output(self : OutputCallbackInfo, logger : &Logger) -> Unit

    OutputCallbackInfo::timestamp

    OutputCallbackInfo::to_string

    fn OutputCallbackInfo::to_string(self : OutputCallbackInfo) -> String

    OutputStreamTimestamp

    pub struct OutputStreamTimestamp {
    callback : StreamInstant
    playback : StreamInstant
    } derive(Eq,
    Debug
    )

    A timestamp associated with a call to an output stream's data callback.

    OutputStreamTimestamp::OutputStreamTimestamp

    fn OutputStreamTimestamp::OutputStreamTimestamp(callback : StreamInstant, playback : StreamInstant) -> OutputStreamTimestamp

    OutputStreamTimestamp::callback

    OutputStreamTimestamp::equal

    OutputStreamTimestamp::new

    OutputStreamTimestamp::not_equal

    OutputStreamTimestamp::output

    fn OutputStreamTimestamp::output(self : OutputStreamTimestamp, logger : &Logger) -> Unit

    OutputStreamTimestamp::playback

    OutputStreamTimestamp::to_string

    fn OutputStreamTimestamp::to_string(self : OutputStreamTimestamp) -> String

    SampleFormat

    pub(all) enum SampleFormat {
    I8
    I16
    I24
    I32
    I64
    U8
    U16
    U24
    U32
    U64
    F32
    F64
    DsdU8
    DsdU16
    DsdU32
    } derive(Eq,
    Debug
    )

    SampleFormat::bits_per_sample

    fn SampleFormat::bits_per_sample(self : SampleFormat) -> Int

    SampleFormat::equal

    SampleFormat::is_dsd

    fn SampleFormat::is_dsd(self : SampleFormat) -> Bool

    SampleFormat::is_float

    fn SampleFormat::is_float(self : SampleFormat) -> Bool

    SampleFormat::is_int

    fn SampleFormat::is_int(self : SampleFormat) -> Bool

    SampleFormat::is_uint

    fn SampleFormat::is_uint(self : SampleFormat) -> Bool

    SampleFormat::not_equal

    fn SampleFormat::not_equal(x : SampleFormat, y : SampleFormat) -> Bool

    SampleFormat::output

    fn SampleFormat::output(self : SampleFormat, logger : &Logger) -> Unit

    SampleFormat::sample_size

    fn SampleFormat::sample_size(self : SampleFormat) -> Int

    SampleFormat::to_debug_string

    fn SampleFormat::to_debug_string(self : SampleFormat) -> String

    SampleFormat::to_string

    fn SampleFormat::to_string(self : SampleFormat) -> String

    StreamConfig

    pub struct StreamConfig {
    channels : Int
    sample_rate : Int
    buffer_size : BufferSize
    } derive(Eq,
    Debug
    )

    StreamConfig::StreamConfig

    fn StreamConfig::StreamConfig(channels : Int, sample_rate : Int, buffer_size : BufferSize) -> StreamConfig

    StreamConfig::equal

    StreamConfig::new

    fn StreamConfig::new(channels : Int, sample_rate : Int, buffer_size : BufferSize) -> StreamConfig

    StreamConfig::not_equal

    fn StreamConfig::not_equal(x : StreamConfig, y : StreamConfig) -> Bool

    StreamConfig::output

    fn StreamConfig::output(self : StreamConfig, logger : &Logger) -> Unit

    StreamConfig::to_string

    fn StreamConfig::to_string(self : StreamConfig) -> String

    StreamInstant

    pub struct StreamInstant {
    secs : Int64
    nanos : Int
    } derive(Eq,
    Debug
    )

    Monotonic timestamp associated with a stream.

    StreamInstant::StreamInstant

    fn StreamInstant::StreamInstant(secs : Int64, nanos : Int) -> StreamInstant

    StreamInstant::add

    fn StreamInstant::add(self : StreamInstant, duration : Duration) -> StreamInstant?

    Return the instant after the given duration has passed.

    StreamInstant::duration_since

    fn StreamInstant::duration_since(self : StreamInstant, earlier : StreamInstant) -> Duration?

    The amount of time elapsed from another instant to this one.

    Returns None if earlier is later than self.

    StreamInstant::equal

    StreamInstant::new

    fn StreamInstant::new(secs : Int64, nanos : Int) -> StreamInstant

    StreamInstant::not_equal

    fn StreamInstant::not_equal(x : StreamInstant, y : StreamInstant) -> Bool

    StreamInstant::output

    fn StreamInstant::output(self : StreamInstant, logger : &Logger) -> Unit

    StreamInstant::sub

    fn StreamInstant::sub(self : StreamInstant, duration : Duration) -> StreamInstant?

    Return the instant one duration ago.

    StreamInstant::to_string

    fn StreamInstant::to_string(self : StreamInstant) -> String

    SupportedBufferSize

    pub(all) enum SupportedBufferSize {
    Range(min~ : Int, max~ : Int)
    Unknown
    } derive(Eq,
    Debug
    )

    SupportedBufferSize::contains

    fn SupportedBufferSize::contains(self : SupportedBufferSize, frames : Int) -> Bool

    SupportedBufferSize::equal

    SupportedBufferSize::not_equal

    SupportedBufferSize::output

    fn SupportedBufferSize::output(self : SupportedBufferSize, logger : &Logger) -> Unit

    SupportedBufferSize::to_string

    fn SupportedBufferSize::to_string(self : SupportedBufferSize) -> String

    SupportedStreamConfig

    pub struct SupportedStreamConfig {
    buffer_size : SupportedBufferSize
    channels : Int
    sample_rate : Int
    sample_format : SampleFormat
    } derive(Eq,
    Debug
    )

    A single supported stream configuration (as opposed to a range).

    Mirrors cpal's SupportedStreamConfig shape used by default_*_config.

    SupportedStreamConfig::SupportedStreamConfig

    fn SupportedStreamConfig::SupportedStreamConfig(channels : Int, sample_rate : Int, buffer_size : SupportedBufferSize, sample_format : SampleFormat) -> SupportedStreamConfig

    SupportedStreamConfig::buffer_size

    SupportedStreamConfig::channels

    fn SupportedStreamConfig::channels(self : SupportedStreamConfig) -> Int

    SupportedStreamConfig::config

    SupportedStreamConfig::equal

    SupportedStreamConfig::new

    fn SupportedStreamConfig::new(channels : Int, sample_rate : Int, buffer_size : SupportedBufferSize, sample_format : SampleFormat) -> SupportedStreamConfig

    SupportedStreamConfig::not_equal

    SupportedStreamConfig::output

    fn SupportedStreamConfig::output(self : SupportedStreamConfig, logger : &Logger) -> Unit

    SupportedStreamConfig::sample_format

    SupportedStreamConfig::sample_rate

    fn SupportedStreamConfig::sample_rate(self : SupportedStreamConfig) -> Int

    SupportedStreamConfig::to_string

    fn SupportedStreamConfig::to_string(self : SupportedStreamConfig) -> String

    SupportedStreamConfigRange

    pub struct SupportedStreamConfigRange {
    buffer_size : SupportedBufferSize
    channels : Int
    min_sample_rate : Int
    max_sample_rate : Int
    sample_format : SampleFormat
    } derive(Eq,
    Debug
    )

    SupportedStreamConfigRange::SupportedStreamConfigRange

    fn SupportedStreamConfigRange::SupportedStreamConfigRange(channels : Int, min_sample_rate : Int, max_sample_rate : Int, buffer_size : SupportedBufferSize, sample_format : SampleFormat) -> SupportedStreamConfigRange

    SupportedStreamConfigRange::buffer_size

    SupportedStreamConfigRange::channels

    SupportedStreamConfigRange::cmp_default_heuristics

    fn SupportedStreamConfigRange::cmp_default_heuristics(self : SupportedStreamConfigRange, other : SupportedStreamConfigRange) -> Int

    Compare two supported config ranges using the same "default config" heuristics as upstream.

    Returns:
    • negative if self has lower priority
    • 0 if equal priority
    • positive if self has higher priority

    SupportedStreamConfigRange::equal

    SupportedStreamConfigRange::max_sample_rate

    fn SupportedStreamConfigRange::max_sample_rate(self : SupportedStreamConfigRange) -> Int

    SupportedStreamConfigRange::min_sample_rate

    fn SupportedStreamConfigRange::min_sample_rate(self : SupportedStreamConfigRange) -> Int

    SupportedStreamConfigRange::new

    fn SupportedStreamConfigRange::new(channels : Int, min_sample_rate : Int, max_sample_rate : Int, buffer_size : SupportedBufferSize, sample_format : SampleFormat) -> SupportedStreamConfigRange

    Public constructor for black-box tests and downstream users.

    SupportedStreamConfigRange::not_equal

    SupportedStreamConfigRange::output

    fn SupportedStreamConfigRange::output(self : SupportedStreamConfigRange, logger : &Logger) -> Unit

    SupportedStreamConfigRange::sample_format

    SupportedStreamConfigRange::to_string

    SupportedStreamConfigRange::try_with_sample_rate

    fn SupportedStreamConfigRange::try_with_sample_rate(self : SupportedStreamConfigRange, sample_rate : Int) -> SupportedStreamConfig?

    Retrieve a SupportedStreamConfig with the given sample rate.

    Returns None if sample_rate is outside [min_sample_rate, max_sample_rate].

    SupportedStreamConfigRange::with_max_sample_rate

    Turns this range into a SupportedStreamConfig corresponding to the maximum sample rate.

    SupportedStreamConfigRange::with_sample_rate

    fn SupportedStreamConfigRange::with_sample_rate(self : SupportedStreamConfigRange, sample_rate : Int) -> SupportedStreamConfig

    Retrieve a SupportedStreamConfig with the given sample rate.

    Panics

    Panics if sample_rate is outside [min_sample_rate, max_sample_rate].

    U24

    pub struct U24 {
    raw : Int
    } derive(Eq,
    Debug
    )

    impl FromSample for U24
    impl Sample for U24
    impl SizedSample for U24
    impl Show for U24

    U24::U24

    fn U24::U24(raw : Int) -> U24

    U24::equal

    fn U24::equal(U24, U24) -> Bool

    U24::equilibrium

    fn U24::equilibrium() -> U24

    U24::format

    fn U24::format(_self : U24) -> SampleFormat

    U24::from_f32

    fn U24::from_f32(x : Float) -> U24

    U24::from_sample

    fn U24::from_sample(x : Float) -> U24

    U24::new

    fn U24::new(raw : Int) -> U24

    U24::not_equal

    fn U24::not_equal(x : U24, y : U24) -> Bool

    U24::output

    fn U24::output(self : U24, logger : &Logger) -> Unit

    U24::to_f32

    fn U24::to_f32(self : U24) -> Float

    U24::to_int

    fn U24::to_int(self : U24) -> Int

    U24::to_repr

    U24::to_string

    fn U24::to_string(self : U24) -> String

    build_stream_error_backend_specific

    fn build_stream_error_backend_specific(description : String) -> BuildStreamError

    build_stream_error_device_busy

    fn build_stream_error_device_busy() -> BuildStreamError

    build_stream_error_device_not_available

    fn build_stream_error_device_not_available() -> BuildStreamError

    build_stream_error_invalid_argument

    fn build_stream_error_invalid_argument() -> BuildStreamError

    build_stream_error_stream_config_not_supported

    fn build_stream_error_stream_config_not_supported() -> BuildStreamError

    build_stream_error_stream_id_overflow

    fn build_stream_error_stream_id_overflow() -> BuildStreamError

    common_sample_rates

    fn common_sample_rates() -> Array[Int]

    default_stream_config_error_backend_specific

    fn default_stream_config_error_backend_specific(description : String) -> DefaultStreamConfigError

    default_stream_config_error_device_busy

    fn default_stream_config_error_device_busy() -> DefaultStreamConfigError

    default_stream_config_error_device_not_available

    fn default_stream_config_error_device_not_available() -> DefaultStreamConfigError

    default_stream_config_error_stream_type_not_supported

    fn default_stream_config_error_stream_type_not_supported() -> DefaultStreamConfigError

    device_id_error_backend_specific

    fn device_id_error_backend_specific(description : String) -> DeviceIdError

    device_id_error_unsupported_platform

    fn device_id_error_unsupported_platform() -> DeviceIdError

    device_name_error_backend_specific

    fn device_name_error_backend_specific(description : String) -> DeviceNameError

    devices_error_backend_specific

    fn devices_error_backend_specific(description : String) -> DevicesError

    direction_from_caps

    fn direction_from_caps(has_input : Bool, has_output : Bool) -> DeviceDirection

    direction_from_counts

    fn direction_from_counts(input_channels : Int?, output_channels : Int?) -> DeviceDirection

    host_unavailable

    fn host_unavailable() -> HostUnavailable

    native_os

    fn native_os() -> NativeOs

    pause_stream_error_backend_specific

    fn pause_stream_error_backend_specific(description : String) -> PauseStreamError

    pause_stream_error_device_not_available

    fn pause_stream_error_device_not_available() -> PauseStreamError

    play_stream_error_backend_specific

    fn play_stream_error_backend_specific(description : String) -> PlayStreamError

    play_stream_error_device_not_available

    fn play_stream_error_device_not_available() -> PlayStreamError

    sample_cast

    fn[A : Sample, B : Sample] sample_cast(x : A) -> B

    sleep_millis

    fn sleep_millis(ms : Int) -> Unit

    stream_error_backend_specific

    fn stream_error_backend_specific(description : String) -> StreamError

    stream_error_buffer_underrun

    fn stream_error_buffer_underrun() -> StreamError

    stream_error_device_not_available

    fn stream_error_device_not_available() -> StreamError

    stream_error_stream_invalidated

    fn stream_error_stream_invalidated() -> StreamError

    string_to_ascii_bytes

    fn string_to_ascii_bytes(s : String) -> Bytes

    Encode a string into ASCII bytes (best-effort).

    This is intended for native backend identifiers like default or hw:0,0. Any non-ASCII chars are replaced with ?.

    string_to_utf8_bytes

    fn string_to_utf8_bytes(s : String) -> Bytes

    Encode a string into UTF-8 bytes.

    This is needed for native backends that require UTF-8 identifiers (e.g. WASAPI endpoint IDs).

    supported_stream_configs_error_backend_specific

    fn supported_stream_configs_error_backend_specific(description : String) -> SupportedStreamConfigsError

    supported_stream_configs_error_device_busy

    fn supported_stream_configs_error_device_busy() -> SupportedStreamConfigsError

    supported_stream_configs_error_device_not_available

    fn supported_stream_configs_error_device_not_available() -> SupportedStreamConfigsError

    supported_stream_configs_error_invalid_argument

    fn supported_stream_configs_error_invalid_argument() -> SupportedStreamConfigsError

    utf8_bytes_to_string

    fn utf8_bytes_to_string(bytes : Bytes, length : Int) -> String