ScummVM API documentation
EEM::AudioPlayer Class Reference

#include <audio.h>

Public Member Functions

 AudioPlayer (EEMEngine *vm)
 
void setVoiceEnabled (bool enabled)
 
bool voiceEnabled () const
 
void playVoc (const Common::Path &vocPath)
 
bool isVoicePlaying () const
 _VoicePlaying @ 1ff1:01f9.
 
void waitForVoiceDone (uint32 maxMs=60000)
 
void stopVoice ()
 _StopTheVoice @ 1ff1:0283.
 
void playFloppyVoiceSlot (uint slot, uint partner)
 
bool initMysterySounds (uint mysteryNum)
 
void cleanMysterySounds ()
 _CleanMysterySounds @ 202f:05a5.
 
void spoolSound (uint num)
 
void waitForSpoolDone (uint32 maxMs=60000)
 
void stopSpool ()
 Immediate _AIL_stop_digital_playback exit.
 
bool isSpoolPlaying () const
 
void sayKDDigital (const byte *kdTextIndex, uint kdspeak, uint partner)
 
void sayKDHintDigital (const byte *kdTextIndex, uint slot, uint partner)
 
void stopAll ()
 _QuitSounds @ 1ff1:03c5.
 

Detailed Description

Non-MIDI audio (digitised voice + SFX). Mirrors SOUND.C / SPOOLSND.C.

  • VOC files (THUNDER.VOC, PHONE.VOC, JEN.VOC/JAKE.VOC): _LoadSoundName + _PlayVoice @ 1ff1:0299 / 1ff1:023e via _AIL_play_VOC_file.
  • DOS mystery spool stream: _InitMysterySounds @ 202f:05cb opens Md.SDX/.SDB. Each SDX entry is (offset, compSize, uncompSize). Equal sizes => raw PCM (_UncompressedSound @ 202f:03e6); otherwise PKWARE DCL Implode (_DeCompressSound @ 202f:02ad). Each blob starts with SB Time Constant + AIL block count, then 8-bit unsigned PCM.
  • Mac mystery spool streams live in M%02d.DBD/M%02d.CPD resource forks. The executable tries compressed 'csnd' by resource id, then falls back to plain 'snd '; ids are 1001 + the zero-based mystery voice slot.

M60.SDB/SDX holds the 19 voiceovers between ANIM01..ANIM20 in _DoOpeningAnims (loaded via _InitMysterySounds(0x3c)). M0..M55 hold per-mystery clue voice + partner KDDigital lines.

Member Function Documentation

◆ setVoiceEnabled()

void EEM::AudioPlayer::setVoiceEnabled ( bool  enabled)
inline

Setup-screen voice toggle. Mirrors DAT_2d5d_3f97 — every original _PlayVoice / _SpoolSound is wrapped in if ((DAT_2d5d_3f97 != 0) && (_VoiceAvailable != 0)); we pull the flag in here so callers don't duplicate the gate.

◆ playVoc()

void EEM::AudioPlayer::playVoc ( const Common::Path vocPath)

Loads the named .VOC from the game directory and hands it to the speech mixer channel. Mirrors _LoadSoundName + _PlayVoice @ 1ff1:0299 / 1ff1:023e. A new playVoc cancels any prior voice.

◆ waitForVoiceDone()

void EEM::AudioPlayer::waitForVoiceDone ( uint32  maxMs = 60000)

_WaitForVoiceDone @ 1ff1:0221. Blocks (with frame + event pumping) until the voice clip finishes; returns early on click / keypress.

◆ playFloppyVoiceSlot()

void EEM::AudioPlayer::playFloppyVoiceSlot ( uint  slot,
uint  partner 
)

Play a floppy VOC by 0..25 slot index in the per-partner voice table. Mirrors _LoadSoundName_Floppy @ 1f4e:0305 (tables at 2608:0f0e Jake / 2608:0f76 Jenny). partner: 0=Jake, 1=Jenny. Common slots: 12 = PHONESL.VOC, 20 = partner intro, 25 = THUNDER.VOC.

◆ initMysterySounds()

bool EEM::AudioPlayer::initMysterySounds ( uint  mysteryNum)

Loads the current mystery voice bundle. DOS uses Mu.SDX/Mu.SDB; Mac uses M%02u.DBD/M%02u.CPD 'csnd'/'snd ' resources.

◆ spoolSound()

void EEM::AudioPlayer::spoolSound ( uint  num)

Reads + decompresses SDX entry num from the active SDB and queues it for SFX playback. Mirrors _SpoolSound @ 202f:068d. Original blocks until playback finishes; we run async — use waitForSpoolDone to opt in to the original block-then-continue semantics.

◆ waitForSpoolDone()

void EEM::AudioPlayer::waitForSpoolDone ( uint32  maxMs = 60000)

Wait loop inside _UncompressedSound / _DeCompressSound; aborts on click / keypress (same abort behaviour as the original).

◆ sayKDDigital()

void EEM::AudioPlayer::sayKDDigital ( const byte *  kdTextIndex,
uint  kdspeak,
uint  partner 
)

Mirrors _SayKDDigital(kdspeak) @ 2404:0fbc. Each mystery embeds a KDDigitalIndex table 18 bytes (+0x12) after its KDTextIndex header (set up by _ReadMystery @ 2404:008f: _KDDigitalIndex = _KDTextIndex

  • 0x12). Table is two 1-based sound indices per kdspeak slot — Jen at +2, Jake at +4 from each entry start (+1 word skips an unused header slot). Pass the mystery's kdTextIndex() pointer.

◆ sayKDHintDigital()

void EEM::AudioPlayer::sayKDHintDigital ( const byte *  kdTextIndex,
uint  slot,
uint  partner 
)

_SayKDHintDigital @ 2542:187e — EEM2/London partner chain-hint voice. Like sayKDDigital but indexes the table 0x3a after KDTextIndex (vs 0x12) with no +1 bias. slot is the 0..4 hint-chain slot.


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