Module nstd::audio

source · []

Structs

Represents an audio play stream.

Represents a stream config. NOTE: buffer_size will be set to 0 for default.

Enums

Represents an audio sample format.

Functions

Frees a device. Parameters: NSTDAudioDevice *const device - Pointer to a device.

Gets the name of a device. Parameters: const NSTDAudioDevice device - The device. Returns: NSTDString name - The device name.

Gets the default audio host. Returns: NSTDAudioHost host - The default audio host.

Frees a host’s memory. Parameters: NSTDAudioHost *const host - Pointer to an audio host.

Frees a play stream. Parameters: NSTDAudioPlayStream *const stream - The play stream.

Creates a play stream. Returns: NSTDAudioPlayStream stream - The new play stream.

Appends audio to a sink from a file. Parameters: const NSTDAudioSink sink - The audio sink. const NSTDFile *const file - The audio file. const NSTDBool should_loop - Nonzero if the audio should be looped. Returns: NSTDErrorCode errc - Nonzero on error.

Detaches a sink from it’s thread while freeing its memory. Parameters: NSTDAudioSink *const sink - The audio sink.

Frees an audio sink. Parameters: NSTDAudioSink *const sink - The audio sink.

Returns the volume of the audio sink. Parameters: const NSTDAudioSink sink - The audio sink. Returns: NSTDFloat32 volume - The volume of the sink.

Checks if an audio sink is paused. Parameters: const NSTDAudioSink sink - The audio sink. Returns: NSTDBool is_paused - Whether or not the audio sink is paused.

Gets the number of audio sources currently in a sink. Parameters: const NSTDAudioSink sink - The audio sink. Returns: NSTDUSize size - The number of audio sources in an audio sink.

Creates a new audio sink. Parameters: const NSTDAudioPlayStream *const stream - The stream to create the sink on. Returns: NSTDAudioSink sink - The new audio sink.

Pauses an audio sink. Parameters: const NSTDAudioSink sink - The audio sink.

Plays an audio sink. Parameters: const NSTDAudioSink sink - The audio sink.

Sets the volume of the audio sink. Parameters: const NSTDAudioSink sink - The audio sink. const NSTDFloat32 volume - The volume of the sink.

Sleeps the current thread until all sounds in the sink are done playing. Parameters: const NSTDAudioSink sink - The audio sink.

Stops audio playback for a sink by clearing it’s queue. Parameters: const NSTDAudioSink sink - The audio sink.

Frees an audio stream Parameters: NSTDAudioStream *const stream - Pointer to an audio stream.

Type Definitions

Represents an audio device.

Represents an audio host.

Represents an audio sink.

Represents an audio stream.