Skip to content

Engine → Audio

voice.h

Voice identity and parameters.

Structs

File Description
play_params Everything play() needs. Values outside the documented ranges are clamped at the API boundary; NaN becomes the default.
voice_id Handle of a voice: the slot key of the engine's voice table. 8 bytes, trivially copyable, mirrored by the C# AudioSource struct. A stale id is rejected by every engine call.
voice_info Main-thread mirror of a voice, refreshed by audio_engine::update() and end_frame().

Functions

Public

clamp_pan

[[nodiscard]] CONJURE_API f32 clamp_pan(
    f32 pan) noexcept;

clamp_pitch

[[nodiscard]] CONJURE_API f32 clamp_pitch(
    f32 pitch) noexcept;

clamp_play_params

[[nodiscard]] CONJURE_API play_params clamp_play_params(
    const play_params &params) noexcept;

Clamp rules applied to every field: volume [0, 2], pitch [0.25, 4], pan [-1, 1], minDistance >= 0.01, maxDistance >= minDistance, rolloff [0, 10], startSeconds >= 0; NaN becomes the field's default.

clamp_volume

[[nodiscard]] CONJURE_API f32 clamp_volume(
    f32 volume) noexcept;

Individual clamp helpers shared by play_params and the engine setters.