本文整理汇总了C++中audio::AudioStream::isStereo方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioStream::isStereo方法的具体用法?C++ AudioStream::isStereo怎么用?C++ AudioStream::isStereo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类audio::AudioStream
的用法示例。
在下文中一共展示了AudioStream::isStereo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cmdRawToWav
bool Console::cmdRawToWav(int argc, const char **argv) {
if (argc != 3) {
debugPrintf("Use %s <rawFilePath> <wavFileName> to dump a .RAW file to .WAV\n", argv[0]);
return true;
}
Common::File file;
if (!_engine->getSearchManager()->openFile(file, argv[1])) {
warning("File not found: %s", argv[1]);
return true;
}
Audio::AudioStream *audioStream = makeRawZorkStream(argv[1], _engine);
Common::DumpFile output;
output.open(argv[2]);
output.writeUint32BE(MKTAG('R', 'I', 'F', 'F'));
output.writeUint32LE(file.size() * 2 + 36);
output.writeUint32BE(MKTAG('W', 'A', 'V', 'E'));
output.writeUint32BE(MKTAG('f', 'm', 't', ' '));
output.writeUint32LE(16);
output.writeUint16LE(1);
uint16 numChannels;
if (audioStream->isStereo()) {
numChannels = 2;
output.writeUint16LE(2);
} else {
numChannels = 1;
output.writeUint16LE(1);
}
output.writeUint32LE(audioStream->getRate());
output.writeUint32LE(audioStream->getRate() * numChannels * 2);
output.writeUint16LE(numChannels * 2);
output.writeUint16LE(16);
output.writeUint32BE(MKTAG('d', 'a', 't', 'a'));
output.writeUint32LE(file.size() * 2);
int16 *buffer = new int16[file.size()];
audioStream->readBuffer(buffer, file.size());
#ifndef SCUMM_LITTLE_ENDIAN
for (int i = 0; i < file.size(); ++i)
buffer[i] = TO_LE_16(buffer[i]);
#endif
output.write(buffer, file.size() * 2);
delete[] buffer;
return true;
}
示例2: getAudioStream
void AVIDecoder::AVIAudioTrack::skipAudio(const Audio::Timestamp &time, const Audio::Timestamp &frameTime) {
Audio::Timestamp timeDiff = time.convertToFramerate(_wvInfo.samplesPerSec) - frameTime.convertToFramerate(_wvInfo.samplesPerSec);
int skipFrames = timeDiff.totalNumberOfFrames();
if (skipFrames <= 0)
return;
Audio::AudioStream *audioStream = getAudioStream();
if (!audioStream)
return;
if (audioStream->isStereo())
skipFrames *= 2;
int16 *tempBuffer = new int16[skipFrames];
audioStream->readBuffer(tempBuffer, skipFrames);
delete[] tempBuffer;
}
示例3: convertRawToWav
void convertRawToWav(const Common::String &inputFile, ZVision *engine, const Common::String &outputFile) {
Common::File file;
if (!file.open(inputFile))
return;
Audio::AudioStream *audioStream = makeRawZorkStream(inputFile, engine);
Common::DumpFile output;
output.open(outputFile);
output.writeUint32BE(MKTAG('R', 'I', 'F', 'F'));
output.writeUint32LE(file.size() * 2 + 36);
output.writeUint32BE(MKTAG('W', 'A', 'V', 'E'));
output.writeUint32BE(MKTAG('f', 'm', 't', ' '));
output.writeUint32LE(16);
output.writeUint16LE(1);
uint16 numChannels;
if (audioStream->isStereo()) {
numChannels = 2;
output.writeUint16LE(2);
} else {
numChannels = 1;
output.writeUint16LE(1);
}
output.writeUint32LE(audioStream->getRate());
output.writeUint32LE(audioStream->getRate() * numChannels * 2);
output.writeUint16LE(numChannels * 2);
output.writeUint16LE(16);
output.writeUint32BE(MKTAG('d', 'a', 't', 'a'));
output.writeUint32LE(file.size() * 2);
int16 *buffer = new int16[file.size()];
audioStream->readBuffer(buffer, file.size());
output.write(buffer, file.size() * 2);
delete[] buffer;
}
示例4: isStereo
bool isStereo() const { return _stream ? _stream->isStereo() : 0; }
示例5: isStereo
bool isStereo() const {
return _stream->isStereo();
}