natiny_clip_load

C
NatinyClip natiny_clip_load(NatinyResource ogg);

Decodes an Ogg Vorbis resource into a clip.

Parameters

Name Type Description
ogg NatinyResource Resource containing Ogg Vorbis data

Returns

Type Description
NatinyClip Clip handle; 0 on failure

Example

C
NatinyClip clip = natiny_clip_load(ogg);

Notes

  • Ogg Vorbis is the only supported format. The complete file is decoded when this function returns; the resource may then be destroyed.
  • A clip is not an entity. Multiple audio sources can share its decoded samples.
  • Decoding costs memory: 16 bits per sample per channel at the file's own rate, held until the clip is destroyed.
  • Audio output need not be available; a clip loads on a machine with no sound card and stays silent.
  • Returns 0 for an invalid resource, invalid Ogg data or allocation failure.