OldSchool Library
OSL_SOUND Struct Reference

Represents a sound object in OSLib. More...

#include <audio.h>

Data Fields

char filename [64]
 Filename for reopening after standby, used if streamed.
 
void * data
 Pointer to sound data, format-specific.
 
void * dataplus
 Pointer to extended sound data.
 
int baseoffset
 Offset in the file to begin playback, excludes header.
 
int format
 Sound format identifier.
 
int divider
 Divider for playback rate adjustment.
 
int size
 Size of the sound data in bytes.
 
int mono
 Mono (0x10) or Stereo (0) output.
 
int isStreamed
 Indicates if the sound is streamed.
 
u16 volumeLeft
 Volume for the left channel.
 
u16 volumeRight
 Volume for the right channel.
 
int suspendNumber
 Suspend management counter.
 
int(* endCallback )(struct OSL_SOUND *, int)
 Callback when playback finishes.
 
u8 userdata [32]
 Custom user data.
 
int numSamples
 Number of samples per read.
 
void(* playSound )(struct OSL_SOUND *)
 Function to start playing the sound.
 
void(* stopSound )(struct OSL_SOUND *)
 Function to stop playing the sound.
 
int(* audioCallback )(unsigned int, void *, unsigned int)
 Buffer fill callback.
 
VIRTUAL_FILE *(* standBySound )(struct OSL_SOUND *)
 Handle entering standby.
 
VIRTUAL_FILE **(* reactiveSound )(struct OSL_SOUND *, VIRTUAL_FILE *)
 Handle exiting standby.
 
void(* deleteSound )(struct OSL_SOUND *)
 Function to delete the sound object.
 

Detailed Description

Represents a sound object in OSLib.

This structure can handle different sound formats and supports both streamed and normal playback. Users can implement custom drivers for other sound types. However, compatibility with future versions is not guaranteed. Please release your source when creating custom implementations.


The documentation for this struct was generated from the following file: