Epok Engine

EPOK RUNTIME

epok::audio_initialize

Function · 1 overload

Function

Performs `audio initialize` as part of SPU sound playback and voice ownership.

Belongs to
epok
Header
audio.hpp
Overloads
1

Declaration

Declaration
inline bool audio_initialize(const AudioClip* clips,size_t count)

Performs `audio initialize` as part of SPU sound playback and voice ownership.

ParameterTypeMeaning
clipsconst AudioClip *Value supplied for clips. Keep referenced or pointed-to data valid for the complete call.
countsize_tValue supplied for count. Keep referenced or pointed-to data valid for the complete call.

Returns: bool. Check the value before continuing when it represents success, availability or a resource handle.

Example

C++ example
#include "audio.hpp"

// Assume these named values have been initialized with valid data:
// const AudioClip * clips
// size_t count

auto result = epok::audio_initialize(clips, count);

Why use it

The boolean result makes success, availability or state explicit without exceptions. The API exposes the hardware service without hiding latency or bounded memory.

Trade-offs and warnings

Check the return value; `false` is part of normal control flow for many PSX resource operations. Treat device absence, busy state and I/O failure as expected outcomes; do not block the frame loop waiting for hardware. Pointer/reference arguments are borrowed unless the source contract says otherwise; keep them valid for the complete operation and never assume null is accepted.

Declared in runtime/audio.hpp:31

Related members