README

Milky2018/moon_cpal/macos does not have a README file

#
DeviceId

type DeviceId = UInt

CoreAudio device discovery (macOS, native backend only).

This is intentionally a small, testable slice: device enumeration and names.

#
CoreAudioError

pub suberror CoreAudioError {
CoreAudioError(String, Int)
DeviceNotAvailable(String, Int)
}

#
Device

pub struct Device {
id : UInt
} derive(Eq,
Debug
)

impl Show for Device

#
Device::name

fn Device::name(self : Device) -> String raise CoreAudioError

#
Device::supported_input_configs

#
Device::supported_output_configs

#
Device::supports_input

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

#
Device::supports_output

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

#
Host

pub struct Host {
_unit : Unit
} derive(Eq,
Debug
)

CPAL-like host/device surface for macOS (CoreAudio).

Includes device enumeration, config queries and native stream I/O (AudioQueue) with MoonBit callback bridging.
impl Show for Host

#
Host::default_input_device

fn Host::default_input_device(_self : Host) -> Device?

#
Host::default_output_device

fn Host::default_output_device(_self : Host) -> Device?

#
Host::devices

fn Host::devices(_self : Host) -> Array[Device] raise CoreAudioError

#
Stream

pub struct Stream {
kind : StreamKind
handle : UInt64
owner : StreamOwner
}

impl Eq for Stream
impl Show for Stream

#
Stream::close

fn Stream::close(self : Stream) -> Unit

#
StreamKind

pub enum StreamKind {
Output
Input
} derive(Eq,
Debug
)

impl Show for StreamKind

#
StreamOwner

type StreamOwner

#
default_host

fn default_host() -> Host

#
default_input_device_id

fn default_input_device_id() -> UInt?

#
default_output_device_id

fn default_output_device_id() -> UInt?

#
device_ids

fn device_ids() -> Array[UInt] raise CoreAudioError

#
device_interface_type_tag

fn device_interface_type_tag(device_id : UInt) -> Int

#
device_is_aggregate

fn device_is_aggregate(device_id : UInt) -> Bool

#
device_manufacturer

fn device_manufacturer(device_id : UInt) -> String?

#
device_name

fn device_name(device_id : UInt) -> String raise CoreAudioError

#
device_transport_type_u32

fn device_transport_type_u32(device_id : UInt) -> UInt

#
device_uid

fn device_uid(device_id : UInt) -> String?

#
supported_configs_error_from_osstatus

fn supported_configs_error_from_osstatus(op : String, status : Int) ->
SupportedStreamConfigsError

Map CoreAudio OSStatus into a cross-platform SupportedStreamConfigsError.

This mirrors CPAL's intent: classify only the small set of errors that have stable meaning across backends, and fall back to a backend-specific error for the rest.

#
supported_input_configs

#
supported_output_configs

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io