XPMP2
X-Plane multiplayer library 2 - using instancing
|
Represents a WAV file, read into memory, played by XP's Sound API. More...
#include <Sound.h>
Public Member Functions | |
SoundWAV (SoundSystem *_pSndSys, const std::string &_filePath, bool _bLoop, float _coneDir, float _conePitch, float _coneInAngle, float _coneOutAngle, float _coneOutVol) | |
Constructor, will load immediately and throw an exception if loading is unsuccessful. More... | |
~SoundWAV () override | |
Destructor. More... | |
bool | isReady () override |
Ready to play? As we load right away in the constructor we're always ready. More... | |
Public Member Functions inherited from XPMP2::SoundFile | |
SoundFile (SoundSystem *_pSndSys, const std::string &_filePath, bool _bLoop, float _coneDir, float _conePitch, float _coneInAngle, float _coneOutAngle, float _coneOutVol) | |
Construct a sound object from a file name and have it loaded asynchonously. More... | |
virtual | ~SoundFile () |
Make sure destructor is virtual. More... | |
SoundFile (const SoundFile &o)=delete | |
Copying is not permitted. More... | |
bool | hasConeInfo () const |
Has full cone information? More... | |
Public Attributes | |
int16_t * | pBuf = nullptr |
audio buffer of PCM16 data More... | |
uint32_t | bufferSize = 0 |
buffer size in bytes More... | |
int | freqHz = 0 |
sound frequency in Hz More... | |
int | numChannels = 0 |
number of channels in the sound sample More... | |
Public Attributes inherited from XPMP2::SoundFile | |
SoundSystem * | pSndSys = nullptr |
Sound system for which this object was created. More... | |
std::string | filePath |
File path to sound file. More... | |
bool | bLoop = true |
sound to be played in a loop? More... | |
float | coneDir = NAN |
Which direction relative to plane's heading does the cone point to? (180 would be typical for jet engines) More... | |
float | conePitch = NAN |
Which pitch does the cone point to (up/down)? (0 would be typical, ie. level with the plane) More... | |
float | coneInAngle = NAN |
Inside cone angle. This is the angle spread within which the sound is unattenuated. More... | |
float | coneOutAngle = NAN |
Outside cone angle. This is the angle spread outside of which the sound is attenuated to its SoundFile::coneOutVol. More... | |
float | coneOutVol = NAN |
Cone outside volume. More... | |
Protected Member Functions | |
void | WavRead () |
Reads a WAV file into a PCM16 memory buffer, throws exceptions in case of errors. More... | |
Represents a WAV file, read into memory, played by XP's Sound API.
XPMP2::SoundWAV::SoundWAV | ( | SoundSystem * | _pSndSys, |
const std::string & | _filePath, | ||
bool | _bLoop, | ||
float | _coneDir, | ||
float | _conePitch, | ||
float | _coneInAngle, | ||
float | _coneOutAngle, | ||
float | _coneOutVol | ||
) |
Constructor, will load immediately and throw an exception if loading is unsuccessful.
|
override |
Destructor.
|
inlineoverridevirtual |
Ready to play? As we load right away in the constructor we're always ready.
Implements XPMP2::SoundFile.
|
protected |
Reads a WAV file into a PCM16 memory buffer, throws exceptions in case of errors.
uint32_t XPMP2::SoundWAV::bufferSize = 0 |
buffer size in bytes
int XPMP2::SoundWAV::freqHz = 0 |
sound frequency in Hz
int XPMP2::SoundWAV::numChannels = 0 |
number of channels in the sound sample
int16_t* XPMP2::SoundWAV::pBuf = nullptr |
audio buffer of PCM16 data