AHI
Audio Hardware Interface (AHI) module provides uniform API to use platform's audio input / output interface for audio capture and playback.
Types
-
Describes format of one sound wave.
-
Represents one audio adapter that can be used to create one device.
-
Describes properties of the playback or capture audio data stream of one device.
-
Describes one audio device.
-
Represents one audio device that can playback sounds.
Enumerations
-
Specifies bit depth of audio samples.
-
Additional flags specified when creating one device.
Alias types
-
using playback_callback_t = u32(void* dst_buffer, const WaveFormat& format, u32 num_frames)
Called when audio data is required by the audio driver. The user should write audio frames to the provided audio buffer for playback.
-
using capture_callback_t = void(const void* src_buffer, const WaveFormat& format, u32 num_frames)
Called when audio data is captured by the audio driver. The user should process such audio data (like coping them to application memory) if needed.
Functions
-
constexpr usize get_frame_size(BitDepth bit_depth, u32 num_channels)
Gets the size of one audio frame in bytes.
-
Gets a list of adapters (driver-provided audio devices) present on the platform.
-
R< Ref< IDevice > > new_device(const DeviceDesc &desc)
Creates one new audio device.