ScummVM API documentation
audio.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef EEM_AUDIO_H
23 #define EEM_AUDIO_H
24 
25 #include "audio/mixer.h"
26 #include "audio/audiostream.h"
27 
28 #include "common/array.h"
29 #include "common/file.h"
30 #include "common/path.h"
31 #include "common/scummsys.h"
32 
33 namespace EEM {
34 
35 class EEMEngine;
36 
56 class AudioPlayer {
57 public:
58  explicit AudioPlayer(EEMEngine *vm);
59  ~AudioPlayer();
60 
65  void setVoiceEnabled(bool enabled) { _voiceEnabled = enabled; }
66  bool voiceEnabled() const { return _voiceEnabled; }
67 
71  void playVoc(const Common::Path &vocPath);
72 
74  bool isVoicePlaying() const;
75 
78  void waitForVoiceDone(uint32 maxMs = 60000);
79 
81  void stopVoice();
82 
87  void playFloppyVoiceSlot(uint slot, uint partner);
88 
91  bool initMysterySounds(uint mysteryNum);
92 
94  void cleanMysterySounds();
95 
100  void spoolSound(uint num);
101 
104  void waitForSpoolDone(uint32 maxMs = 60000);
105 
107  void stopSpool();
108 
109  bool isSpoolPlaying() const;
110 
117  void sayKDDigital(const byte *kdTextIndex, uint kdspeak, uint partner);
118 
122  void sayKDHintDigital(const byte *kdTextIndex, uint slot, uint partner);
123 
125  void stopAll();
126 
127 private:
128  struct SoundEntry {
129  uint32 offset;
130  uint32 compressedSize;
131  uint32 uncompressedSize;
132  };
133 
134  bool readSdxIndex(const Common::Path &sdxPath);
135  bool initMacMysterySounds(uint mysteryNum);
136  bool playMacMysterySound(uint num);
137  void playMacSnd(uint16 resourceId, Audio::SoundHandle &handle,
139  void playPcmBuffer(byte *pcm, uint32 size, uint sampleRate,
140  Audio::SoundHandle &handle,
142 
143  EEMEngine *_vm = nullptr;
144  Audio::Mixer *_mixer = nullptr;
145  Audio::SoundHandle _voiceHandle;
146  Audio::SoundHandle _spoolHandle;
147 
148  Common::Array<SoundEntry> _sdxIndex;
149  Common::Path _sdbPath;
150  Common::Path _macMysterySoundPath;
151  int _currentMystery = -1;
152  bool _voiceEnabled = true;
153  bool _isMacintosh = false;
154 };
155 
156 } // End of namespace EEM
157 
158 #endif
void cleanMysterySounds()
_CleanMysterySounds @ 202f:05a5.
void stopSpool()
Immediate _AIL_stop_digital_playback exit.
void playFloppyVoiceSlot(uint slot, uint partner)
void sayKDHintDigital(const byte *kdTextIndex, uint slot, uint partner)
void spoolSound(uint num)
Definition: path.h:52
void sayKDDigital(const byte *kdTextIndex, uint kdspeak, uint partner)
Definition: audio.h:56
bool isVoicePlaying() const
_VoicePlaying @ 1ff1:01f9.
void playVoc(const Common::Path &vocPath)
Definition: mixer.h:49
SoundType
Definition: mixer.h:73
Definition: mixer.h:70
Definition: animation.h:30
void stopVoice()
_StopTheVoice @ 1ff1:0283.
Definition: eem.h:141
void waitForVoiceDone(uint32 maxMs=60000)
void waitForSpoolDone(uint32 maxMs=60000)
bool initMysterySounds(uint mysteryNum)
void stopAll()
_QuitSounds @ 1ff1:03c5.
void setVoiceEnabled(bool enabled)
Definition: audio.h:65