xoreos  0.0.5
Classes | Namespaces | Macros | Functions
pcm.cpp File Reference

Decoding PCM (Pulse Code Modulation). More...

#include "src/common/disposableptr.h"
#include "src/common/readstream.h"
#include "src/sound/audiostream.h"
#include "src/sound/decoders/pcm.h"
Include dependency graph for pcm.cpp:

Go to the source code of this file.

Classes

class  Sound::PCMStream< is16Bit, isUnsigned, isLE >
 This is a stream, which allows for playing raw PCM data from a stream. More...
 
class  Sound::PacketizedPCMStream
 

Namespaces

 Sound
 

Macros

#define READ_ENDIAN_SAMPLE(is16Bit, isUnsigned, ptr, isLE)   ((is16Bit ? (isLE ? _stream->readUint16LE() : _stream->readUint16BE()) : (_stream->readByte() << 8)) ^ (isUnsigned ? 0x8000 : 0))
 
#define MAKE_RAW_STREAM(UNSIGNED)
 

Functions

RewindableAudioStream * Sound::makePCMStream (Common::SeekableReadStream *stream, int rate, byte flags, int channels, bool disposeAfterUse=true)
 Creates an audio stream, which plays from the given stream. More...
 
PacketizedAudioStream * Sound::makePacketizedPCMStream (int rate, byte flags, int channels)
 Creates a PacketizedAudioStream that will automatically queue packets as individual AudioStreams like returned by makePCMStream. More...
 

Detailed Description

Decoding PCM (Pulse Code Modulation).

Definition in file pcm.cpp.

Macro Definition Documentation

◆ MAKE_RAW_STREAM

#define MAKE_RAW_STREAM (   UNSIGNED)
Value:
if (is16Bit) { \
if (isLE) \
return new PCMStream<true, UNSIGNED, true>(rate, channels, disposeAfterUse, stream); \
else \
return new PCMStream<true, UNSIGNED, false>(rate, channels, disposeAfterUse, stream); \
} else \
return new PCMStream<false, UNSIGNED, false>(rate, channels, disposeAfterUse, stream)

Definition at line 130 of file pcm.cpp.

Referenced by Sound::makePCMStream().

◆ READ_ENDIAN_SAMPLE

#define READ_ENDIAN_SAMPLE (   is16Bit,
  isUnsigned,
  ptr,
  isLE 
)    ((is16Bit ? (isLE ? _stream->readUint16LE() : _stream->readUint16BE()) : (_stream->readByte() << 8)) ^ (isUnsigned ? 0x8000 : 0))

Definition at line 63 of file pcm.cpp.

Referenced by Sound::PCMStream< is16Bit, isUnsigned, isLE >::readBuffer().