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 
55 class AudioPlayer {
56 public:
57  explicit AudioPlayer(EEMEngine *vm);
58  ~AudioPlayer();
59 
64  void setVoiceEnabled(bool enabled) { _voiceEnabled = enabled; }
65  bool voiceEnabled() const { return _voiceEnabled; }
66 
70  void playVoc(const Common::Path &vocPath);
71 
73  bool isVoicePlaying() const;
74 
77  void waitForVoiceDone(uint32 maxMs = 60000);
78 
80  void stopVoice();
81 
86  void playFloppyVoiceSlot(uint slot, uint partner);
87 
90  bool initMysterySounds(uint mysteryNum);
91 
93  void cleanMysterySounds();
94 
99  void spoolSound(uint num);
100 
103  void waitForSpoolDone(uint32 maxMs = 60000);
104 
106  void stopSpool();
107 
108  bool isSpoolPlaying() const;
109 
116  void sayKDDigital(const byte *kdTextIndex, uint kdspeak, uint partner);
117 
121  void sayKDHintDigital(const byte *kdTextIndex, uint slot, uint partner);
122 
124  void stopAll();
125 
126 private:
127  struct SoundEntry {
128  uint32 offset;
129  uint32 compressedSize;
130  uint32 uncompressedSize;
131  };
132 
133  bool readSdxIndex(const Common::Path &sdxPath);
134  bool initMacMysterySounds(uint mysteryNum);
135  bool playMacMysterySound(uint num);
136  void playMacSnd(uint16 resourceId, Audio::SoundHandle &handle,
138  void playPcmBuffer(byte *pcm, uint32 size, uint sampleRate,
139  Audio::SoundHandle &handle,
141 
142  EEMEngine *_vm = nullptr;
143  Audio::Mixer *_mixer = nullptr;
144  Audio::SoundHandle _voiceHandle;
145  Audio::SoundHandle _spoolHandle;
146 
147  Common::Array<SoundEntry> _sdxIndex;
148  Common::Path _sdbPath;
149  Common::Path _macMysterySoundPath;
150  int _currentMystery = -1;
151  bool _voiceEnabled = true;
152  bool _isMacintosh = false;
153 };
154 
155 } // End of namespace EEM
156 
157 #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:55
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:123
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:64