示例#1
0
文件: sound.cpp 项目: Cruel/scummvm
void SoundManager::startVOCPlay(const Common::String &filename) {
	Common::File f;
	if (!f.open(filename))
		error("Could not find voc file - %s", filename.c_str());

	Audio::SeekableAudioStream *audioStream = Audio::makeVOCStream(f.readStream(f.size()),
		Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);

	_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, audioStream);
	audioStream->seek(Audio::Timestamp(_vocOffset * 1000, 11025));
}
示例#2
0
bool AIFFTrack::openSound(const Common::String &filename, const Common::String &soundName, const Audio::Timestamp *start) {
	Common::SeekableReadStream *file = g_resourceloader->openNewStreamFile(filename, true);
	if (!file) {
		Debug::debug(Debug::Sound, "Stream for %s not open", soundName.c_str());
		return false;
	}
	_soundName = soundName;
	Audio::SeekableAudioStream *aiffStream = Audio::makeAIFFStream(file, DisposeAfterUse::YES);
	_stream = aiffStream;
	if (start)
		aiffStream->seek(*start);
	if (!_stream)
		return false;
	_handle = new Audio::SoundHandle();
	return true;
}
示例#3
0
bool VideoDecoder::SeekableAudioTrack::seek(const Audio::Timestamp &time) {
	Audio::SeekableAudioStream *stream = getSeekableAudioStream();
	assert(stream);
	return stream->seek(time);
}