#include <audiostream.h>
Public Member Functions | |
virtual int | readBuffer (int16 *buffer, const int numSamples)=0 |
virtual bool | isStereo () const =0 |
virtual int | getRate () const =0 |
virtual bool | endOfData () const =0 |
virtual bool | endOfStream () const |
Generic audio input stream. Subclasses of this are used to feed arbitrary sampled audio data into ScummVM's audio mixer.
|
pure virtual |
Fill the given buffer with up to numSamples
samples.
Data must be in native endianness, 16 bits per sample, signed. For stereo stream, the buffer will be filled with interleaved left and right channel samples, starting with the left sample. Furthermore, the samples in the left and right are summed up. So if you request 4 samples from a stereo stream, you will get a total of two left channel and two right channel samples.
Implemented in Audio::StatelessPacketizedAudioStream, Sci::RobotAudioStream, Audio::SubSeekableAudioStream, Audio::SubLoopingAudioStream, Audio::DK3_ADPCMStream, Scumm::Player_AppleII, Audio::MS_ADPCMStream, Sword2::Sound, Agi::SoundGen2GS, Sci::Audio32, Scumm::MacPlayerAudioStream, Neverhood::NeverhoodAudioStream, Audio::MSIma_ADPCMStream, Audio::LoopingAudioStream, Audio::Apple_ADPCMStream, Sword2::MusicInputStream, Ultima::Nuvie::PCSpeakerStutterStream, Tinsel::PCMMusicPlayer, Audio::DVI_ADPCMStream, Ultima::Nuvie::PCSpeakerRandomStream, Audio::EmulatedChip, Sword2::CLUInputStream, Audio::XA_ADPCMStream, Audio::Mp3PspStream, ZVision::RawZorkStream, Audio::Paula, Ultima::Nuvie::PCSpeakerSweepFreqStream, Audio::Audio3DO_SDX2_Stream, Tinsel::Tinsel8_ADPCMStream, Audio::Oki_ADPCMStream, MidiDriver_Emulated, Audio::PCSpeaker, Tinsel::Tinsel6_ADPCMStream, TownsPC98_FmSynth, VCruise::SampleLoopAudioStream, Ultima::Nuvie::PCSpeakerFreqStream, Agi::SoundGenPCJr, Agi::SoundGenSarien, Audio::VocStream, Audio::QuickTimeAudioDecoder::QuickTimeAudioTrack, Audio::Audio3DO_ADP4_Stream, Dgds::Mixer_Mac< T >, Sci::Mixer_Mac< T >, Scumm::Player_SID, Tinsel::Tinsel4_ADPCMStream, Toon::AudioStreamInstance, BladeRunner::AudStream, Scumm::Player_MOD, AudioCDStream, Scumm::Player_NES, Gob::SoundMixer, Scumm::Player_V2, Adl::Sound, Ultima::Nuvie::U6AdPlugDecoderStream, Ultima::Nuvie::AdLibSfxStream, MTropolis::AudioPlayer, Ultima::Nuvie::FMtownsDecoderStream, Grim::SCXStream, VCruise::AudioPlayer, Agi::SoundGenA2, and Agi::SoundGenCoCo3.
|
pure virtual |
Check whether this is a stereo stream.
Implemented in Audio::StatelessPacketizedAudioStream, Sci::RobotAudioStream, Audio::SubSeekableAudioStream, Audio::SubLoopingAudioStream, Kyra::MidiDriver_PCSpeaker, Scumm::Player_AppleII, Sword2::Sound, Agi::SoundGen2GS, Sci::Audio32, Scumm::MacPlayerAudioStream, Neverhood::NeverhoodAudioStream, OPL::MAME::OPL, OPL::NUKED::OPL, Audio::LoopingAudioStream, Sword2::MusicInputStream, Tinsel::PCMMusicPlayer, Sword2::CLUInputStream, Audio::Mp3PspStream, ZVision::RawZorkStream, Audio::Paula, OPL::DOSBox::OPL, Audio::Audio3DO_SDX2_Stream, Audio::PCSpeaker, TownsPC98_FmSynth, VCruise::SampleLoopAudioStream, Agi::SoundGenPCJr, DOSBoxCMS, Agi::SoundGenSarien, Audio::VocStream, Audio::QuickTimeAudioDecoder::QuickTimeAudioTrack, Audio::Audio3DO_ADP4_Stream, Scumm::Player_SID, Audio::ADPCMStream, Dgds::Mixer_Mac< T >, Sci::Mixer_Mac< T >, Toon::AudioStreamInstance, Scumm::Player_MOD, BladeRunner::AudStream, AudioCDStream, Scumm::Player_NES, Gob::SoundMixer, Ultima::Nuvie::U6AdPlugDecoderStream, Scumm::Player_V2, Ultima::Nuvie::AdLibSfxStream, Adl::Sound, Ultima::Nuvie::FMtownsDecoderStream, MTropolis::AudioPlayer, Ultima::Nuvie::PCSpeakerStream, Scumm::IMuseDriver_PCSpk, VCruise::AudioPlayer, Agi::SoundGenA2, Agi::SoundGenCoCo3, and Grim::SCXStream.
|
pure virtual |
Sample rate of the stream.
Implemented in Audio::StatelessPacketizedAudioStream, Sci::RobotAudioStream, Audio::SubSeekableAudioStream, Audio::SubLoopingAudioStream, Kyra::MidiDriver_PCSpeaker, Scumm::Player_AppleII, Sword2::Sound, Agi::SoundGen2GS, Sci::Audio32, Scumm::MacPlayerAudioStream, Neverhood::NeverhoodAudioStream, Audio::LoopingAudioStream, Sword2::MusicInputStream, Tinsel::PCMMusicPlayer, Audio::EmulatedChip, Sword2::CLUInputStream, ZVision::RawZorkStream, Audio::Mp3PspStream, Audio::Paula, Audio::Audio3DO_SDX2_Stream, Audio::PCSpeaker, Agi::SoundGenPCJr, TownsPC98_FmSynth, Agi::SoundGenSarien, VCruise::SampleLoopAudioStream, Audio::VocStream, Audio::QuickTimeAudioDecoder::QuickTimeAudioTrack, Scumm::Player_SID, Audio::Audio3DO_ADP4_Stream, Toon::AudioStreamInstance, Audio::ADPCMStream, Dgds::Mixer_Mac< T >, Sci::Mixer_Mac< T >, Scumm::Player_MOD, BladeRunner::AudStream, Scumm::Player_NES, AudioCDStream, Gob::SoundMixer, Ultima::Nuvie::U6AdPlugDecoderStream, Ultima::Nuvie::AdLibSfxStream, Scumm::Player_V2, Adl::Sound, Ultima::Nuvie::FMtownsDecoderStream, Ultima::Nuvie::PCSpeakerStream, Agi::SoundGenA2, Agi::SoundGenCoCo3, MTropolis::AudioPlayer, Scumm::IMuseDriver_PCSpk, VCruise::AudioPlayer, and Grim::SCXStream.
|
pure virtual |
Check whether end of data has been reached.
If this returns true, it indicates that at this time there is no data available in the stream. However, there might be more data in the future.
This is used by e.g. a rate converter to decide whether to keep on converting data or to stop.
Implemented in Audio::StatelessPacketizedAudioStream, Sci::RobotAudioStream, Audio::SubSeekableAudioStream, Audio::SubLoopingAudioStream, Scumm::Player_AppleII, Audio::MS_ADPCMStream, Sword2::Sound, Agi::SoundGen2GS, Sci::Audio32, Scumm::MacPlayerAudioStream, Neverhood::NeverhoodAudioStream, Audio::LoopingAudioStream, Sword2::MusicInputStream, Tinsel::PCMMusicPlayer, Audio::DVI_ADPCMStream, Audio::EmulatedChip, MidiDriver_Emulated, Sword2::CLUInputStream, ZVision::RawZorkStream, Audio::Mp3PspStream, Audio::XA_ADPCMStream, Audio::Paula, Audio::Audio3DO_SDX2_Stream, Audio::PCSpeaker, Audio::Oki_ADPCMStream, Agi::SoundGenPCJr, TownsPC98_FmSynth, VCruise::SampleLoopAudioStream, Agi::SoundGenSarien, Audio::VocStream, Ultima::Nuvie::U6AdPlugDecoderStream, Audio::QuickTimeAudioDecoder::QuickTimeAudioTrack, Toon::AudioStreamInstance, Ultima::Nuvie::AdLibSfxStream, Dgds::Mixer_Mac< T >, Sci::Mixer_Mac< T >, Scumm::Player_SID, Audio::Audio3DO_ADP4_Stream, Audio::ADPCMStream, Scumm::Player_MOD, Ultima::Nuvie::FMtownsDecoderStream, BladeRunner::AudStream, Ultima::Nuvie::PCSpeakerStream, AudioCDStream, Scumm::Player_NES, Gob::SoundMixer, Scumm::Player_V2, Adl::Sound, MTropolis::AudioPlayer, Agi::SoundGenA2, Agi::SoundGenCoCo3, VCruise::AudioPlayer, and Grim::SCXStream.
|
inlinevirtual |
Check whether end of stream has been reached.
If this returns true, it indicates that all data in this stream is used up and no additional data will appear in it in the future.
This is used by the mixer to decide whether a given stream shall be removed from the list of active streams (and thus be destroyed). By default, this maps to endOfData().
Reimplemented in Audio::StatelessPacketizedAudioStream, Sci::RobotAudioStream, Audio::SubSeekableAudioStream, Audio::SubLoopingAudioStream, Sci::Audio32, Audio::LoopingAudioStream, Tinsel::PCMMusicPlayer, Audio::PCSpeaker, Gob::SoundMixer, and Freescape::SizedPCSpeaker.