diff options
author | richiesams | 2013-08-17 09:38:24 -0500 |
---|---|---|
committer | richiesams | 2013-08-18 19:52:42 -0500 |
commit | 7d24f46e7e2c7d6322b2842d349986dc484eb063 (patch) | |
tree | 0a2c6297667cf2b877e214d9f9880c98439982fb /engines | |
parent | 0a840fa664c210dfb85d6c62d4a80a08ca650843 (diff) | |
download | scummvm-rg350-7d24f46e7e2c7d6322b2842d349986dc484eb063.tar.gz scummvm-rg350-7d24f46e7e2c7d6322b2842d349986dc484eb063.tar.bz2 scummvm-rg350-7d24f46e7e2c7d6322b2842d349986dc484eb063.zip |
ZVISION: Modify cmdLoadSound to allow manual rate and isStereo
Usually those variables are parsed from the file name
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/console.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/engines/zvision/console.cpp b/engines/zvision/console.cpp index 6c7ac94181..e7c46b95a9 100644 --- a/engines/zvision/console.cpp +++ b/engines/zvision/console.cpp @@ -83,19 +83,29 @@ bool Console::cmdLoadVideo(int argc, const char **argv) { } bool Console::cmdLoadSound(int argc, const char **argv) { - if (argc != 2) { - DebugPrintf("Use loadsound <fileName> to load a sound\n"); - return true; - } - if (!Common::File::exists(argv[1])) { DebugPrintf("File does not exist\n"); return true; } - Audio::AudioStream *soundStream = makeRawZorkStream(argv[1], _engine); - Audio::SoundHandle handle; - _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, &handle, soundStream, -1, 100, 0, DisposeAfterUse::YES, false, false); + if (argc == 2) { + Audio::AudioStream *soundStream = makeRawZorkStream(argv[1], _engine); + Audio::SoundHandle handle; + _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, &handle, soundStream, -1, 100, 0, DisposeAfterUse::YES, false, false); + + } else if (argc == 4) { + int isStereo = atoi(argv[3]); + + Common::File *file = new Common::File(); + file->open(argv[1]); + + Audio::AudioStream *soundStream = makeRawZorkStream(file, atoi(argv[2]), isStereo == 0 ? false : true); + Audio::SoundHandle handle; + _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, &handle, soundStream, -1, 100, 0, DisposeAfterUse::YES, false, false); + } else { + DebugPrintf("Use loadsound <fileName> [<rate> <isStereo: 1 or 0>] to load a sound\n"); + return true; + } return true; } |