SWILIB API (ELKA)    
Loading...
Searching...
No Matches
sound.h File Reference
#include "base.h"
#include "wstring.h"

Go to the source code of this file.

Data Structures

struct  PLAY_VOLUME
 Volume of a play object (NSG/ELKA), passed by value to PlayMelody_ChangeVolume. More...
 
struct  GBS_PSOUND_MSG
 GBS event (MSG_PLAYFILE_REPORT) for the PlayFile or PlayMelodyInMem. More...
 
struct  PLAYFILE_OPT
 Options for the PlayFile. More...
 

Typedefs

typedef struct GBS_PSOUND_MSG GBS_PSOUND_MSG
 
typedef struct PLAYFILE_OPT PLAYFILE_OPT
 
typedef struct PLAY_VOLUME PLAY_VOLUME
 

Enumerations

enum  PlaySoundEventID {
  M_SAE_EVENT_STARTED = 0 ,
  M_SAE_EVENT_STOPPED = 1 ,
  M_SAE_EVENT_DONE = 2 ,
  M_SAE_EVENT_ERROR = 3 ,
  M_SAE_PLAYBACK_STARTED = 4 ,
  M_SAE_PLAYBACK_ERROR = 5 ,
  M_SAE_PLAYBACK_NEXTCYCLE = 6 ,
  M_SAE_PLAYBACK_DONE = 7 ,
  M_SAE_VOLUME_UPDATED = 8 ,
  M_SAE_VOLUME_ERROR = 9 ,
  M_SAE_EQUALIZER_UPDATED = 0xA ,
  M_SAE_EQUALIZER_ERROR = 0xB ,
  M_SAE_3DAUDIO_UPDATED = 0xC ,
  M_SAE_3DAUDIO_ERROR = 0xD ,
  M_SAE_UNKNOWN_EVENT = 0xE ,
  M_SAE_UNKNOWN_EVENT_1 = 0xF ,
  M_SAE_PLAYTIME_UPDATED = 0x10 ,
  M_SAE_PLAYTIME_ERROR = 0x11 ,
  M_SAE_HANDSFREE_UPDATED = 0x12 ,
  M_SAE_HANDSFREE_ERROR = 0x13 ,
  M_SAE_RECORD_STARTED = 0x14 ,
  M_SAE_RECORD_ERROR = 0x15 ,
  M_SAE_RECORD_DONE = 0x16 ,
  M_SAE_STOP_OK = 0x17 ,
  M_SAE_STOP_FAIL = 0x18 ,
  M_SAE_CANCEL_OK = 0x19 ,
  M_SAE_CANCEL_FAIL = 0x1A ,
  M_SAE_PAUSE_OK = 0x1B ,
  M_SAE_PAUSE_FAIL = 0x1C ,
  M_SAE_RESUME_OK = 0x1D ,
  M_SAE_RESUME_FAIL = 0x1E ,
  M_SAE_INFO_DATA_AVAILABLE = 0x1F ,
  M_SAE_INFO_REQUEST_FAIL = 0x20 ,
  M_SAE_MAX_RECORDING_TIME_AVAILABLE = 0x21 ,
  M_SAE_MAX_RECORDING_TIME_ERROR = 0x22 ,
  M_SAE_UNKNOWN_EVENT_2 = 0x23 ,
  M_SAE_UNKNOWN_EVENT_3 = 0x24 ,
  M_SAE_AUDIO_EVENT_STOPPED = 0x25 ,
  M_SAE_AUDIO_EVENT_PAUSED = 0x26 ,
  M_SAE_AUDIO_EVENT_RESUMED = 0x27 ,
  M_SAE_VISUALIZATION_STOPPED = 0x28 ,
  M_SAE_VISUALIZATION_STARTED = 0x29 ,
  M_SAE_UNKNOWN_EVENT_4 = 0x2A ,
  M_SAE_VISUALIZATION_DATA = 0x2B ,
  M_SAE_STREAM_READY = 0x2C ,
  M_SAE_STREAM_STALLED = 0x2D ,
  M_SAE_STREAM_UNSTALLED = 0x2E ,
  M_SAE_STREAM_LOW_WATERMARK = 0x2F ,
  M_SAE_STREAM_HIGH_WATERMARK = 0x30 ,
  M_SAE_BUFFER_CONSUMED = 0x31 ,
  M_SAE_BUFFER_AVAILABLE = 0x32 ,
  M_SAE_RESERVE_OK = 0x33 ,
  M_SAE_RESERVE_FAIL = 0x34 ,
  M_SAE_RELEASE_OK = 0x35 ,
  M_SAE_RELEASE_FAIL = 0x36 ,
  M_SAE_RELEASED = 0x37 ,
  M_SAE_VOLUME_CHANGED = 0x38 ,
  M_SAE_SOUNDSTATE_CHANGED = 0x39 ,
  M_SAE_SOUNDSYSTEM_IDLE = 0x3A ,
  M_SAE_EVENT_IN_STACK = 0x3B
}
 Event IDs for the GBS_PSOUND_MSG. More...
 
enum  PlaySoundJobID {
  Job_NoJob = 0 ,
  Job_RecFile = 1 ,
  Job_RecBuffer = 2 ,
  Job_PlayFile = 3 ,
  Job_PlayBuffer = 5 ,
  Job_GetInfo = 0xF ,
  Job_GetRecordingTimeMax = 0x10
}
 Job IDs for the GBS_PSOUND_MSG. More...
 
enum  PlaySoundVolumeID {
  VOLUME_CALLS = 0 ,
  VOLUME_SYSTEM = 1 ,
  VOLUME_WALKY_TALKY = 2 ,
  VOLUME_MESSAGES = 4 ,
  VOLUME_CB_SERVICES = 6 ,
  VOLUME_ALARM_CLOCK = 9 ,
  VOLUME_ORGANISER = 0xA ,
  VOLUME_APPLICATIONS = 0xC
}
 Volume (=category) for tones (PlaySound). More...
 

Functions

char * RamVolumeLevel ()
 Get current volume level.
 
char * RamMediaIsPlaying ()
 Copy of a PASIC audio register, historically used to check if a sound is played.
 
int IsPlayerOn ()
 Check if the radio or player is active.
 
int GetPlayStatus (void)
 Get status of the MediaPlayer.
 
void PlaySound (long volume, long cepid, long unk1, long tone_type, long unk2)
 Play tone by id.
 
int PlayMelodyInMem (char unk1, const void *buffer, int size, int cepid, int msg, int unk2)
 Play melody from memory.
 
int PlayMelody_ChangeVolume (int handle, PLAY_VOLUME volume)
 Change the volume of the playing melody.
 
int PlayMelody_SetVolume (int handle, PLAY_VOLUME volume)
 Change the volume of the playing melody.
 
int PlayMelody_GetVolume (int handle, PLAY_VOLUME *volume)
 Get the volume of the playing melody.
 
int PlayMelody_StopPlayback (int handle)
 Stop the playback of the melody.
 
int PlayMelody_PausePlayback (int handle)
 Pause the playback of the melody.
 
int PlayMelody_ResumePlayBack (int handle)
 Resume the playback of the melody.
 
int PlayMelody_SetPosition (int handle, int position)
 Set the position of the playing melody.
 
void * GetPlayObjById (int handle)
 Get a pointer to the PlayObject by PlayObject handle.
 
int GetPlayObjPosition (void *obj, int *position)
 Get the current position from Obs or PlayObj (generic).
 
int GetPlayObjDuration (void *obj, int *duration)
 Get the duration of from Obs or PlayObj (generic).
 
static int PlayMelody_GetPosition (int handle, int *position)
 Get the current position of the playing melody.
 
static int PlayMelody_GetDuration (int handle, int *duration)
 Get the duration of the playing melody.
 
short PlayFile (int flags, const WSHDR *folder, const WSHDR *file, int cepid, int msgid, const PLAYFILE_OPT *sfo)
 Play file from filesystem (path=folder\file).
 
int Audio_GetCurrAudioPath (void)
 Get current audio path.
 
int Audio_GetObjectHandle ()
 Get current object handle.
 
int AACC_AudioTransferReq (int oh, uint32_t type_and_conn)
 Change audio output.
 
void PlaySoundLoop (int unk1, int unk2, int duration)
 Play vibra tone (???).
 
int ChangeVolume (uint8_t volume)
 Change the current audio volume.
 
short SoundAE_PlayFileAsEvent (int event_id, int cepid, int msg_id, const WSHDR *folder, const WSHDR *file)
 Play custom sound.
 
void * RamAudioHook ()
 Pointer to the AudioHook.
 
char * RamIsSoundRecordingActive ()
 Check if active recording of the sound.
 
char * RamSoundRecordingQuality ()
 Quality of the current sound recording.