aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/sound.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2007-10-07 19:18:41 +0000
committerNicola Mettifogo2007-10-07 19:18:41 +0000
commit8a73ce38bbc2c205fb67e274d0c3304b460b9a53 (patch)
treec03524371f8862fb2bd64b1b424a921aa7974cb4 /engines/parallaction/sound.cpp
parent205b65ba115581b54e38c1ae8aef10c76fbdab65 (diff)
downloadscummvm-rg350-8a73ce38bbc2c205fb67e274d0c3304b460b9a53.tar.gz
scummvm-rg350-8a73ce38bbc2c205fb67e274d0c3304b460b9a53.tar.bz2
scummvm-rg350-8a73ce38bbc2c205fb67e274d0c3304b460b9a53.zip
Added beep sound to Nippon Safes for Amiga.
svn-id: r29171
Diffstat (limited to 'engines/parallaction/sound.cpp')
-rw-r--r--engines/parallaction/sound.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/engines/parallaction/sound.cpp b/engines/parallaction/sound.cpp
index 605a71bbdd..4d4386b642 100644
--- a/engines/parallaction/sound.cpp
+++ b/engines/parallaction/sound.cpp
@@ -318,6 +318,28 @@ AmigaSoundMan::~AmigaSoundMan() {
stopSfx(3);
}
+static byte res_amigaBeep[] = {
+ 0, 20, 40, 60, 80, 60, 40, 20, 0, 236, 216, 196, 176, 196, 216, 236
+};
+
+void AmigaSoundMan::loadChannelData(const char *filename, Channel *ch) {
+ if (!scumm_stricmp("beep", filename)) {
+ ch->header.oneShotHiSamples = 0;
+ ch->header.repeatHiSamples = 0;
+ ch->header.samplesPerHiCycle = 0;
+ ch->header.samplesPerSec = 12000;
+ ch->header.volume = 255;
+ ch->data = res_amigaBeep;
+ ch->dataSize = 16;
+ return;
+ }
+
+ Common::ReadStream *stream = _vm->_disk->loadSound(filename);
+ Audio::A8SVXDecoder decoder(*stream, ch->header, ch->data, ch->dataSize);
+ decoder.decode();
+ delete stream;
+}
+
void AmigaSoundMan::playSfx(const char *filename, uint channel, bool looping, int volume, int rate) {
if (channel >= NUM_AMIGA_CHANNELS) {
warning("unknown sfx channel");
@@ -327,10 +349,7 @@ void AmigaSoundMan::playSfx(const char *filename, uint channel, bool looping, in
debugC(1, kDebugAudio, "AmigaSoundMan::playSfx(%s, %i)", filename, channel);
Channel *ch = &_channels[channel];
- Common::ReadStream *stream = _vm->_disk->loadSound(filename);
- Audio::A8SVXDecoder decoder(*stream, ch->header, ch->data, ch->dataSize);
- decoder.decode();
- delete stream;
+ loadChannelData(filename, ch);
uint32 loopStart, loopEnd, flags;
if (looping) {