Represents a WAV file, read into memory, played by XP's Sound API.
More...
#include <Sound.h>
|
| | 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.
|
| |
| | ~SoundWAV () override |
| | Destructor.
|
| |
| bool | isReady () override |
| | Ready to play? As we load right away in the constructor we're always ready.
|
| |
| | 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.
|
| |
| virtual | ~SoundFile () |
| | Make sure destructor is virtual.
|
| |
| | SoundFile (const SoundFile &o)=delete |
| | Copying is not permitted.
|
| |
| bool | hasConeInfo () const |
| | Has full cone information?
|
| |
|
| int16_t * | pBuf = nullptr |
| | audio buffer of PCM16 data
|
| |
| uint32_t | bufferSize = 0 |
| | buffer size in bytes
|
| |
| int | freqHz = 0 |
| | sound frequency in Hz
|
| |
| int | numChannels = 0 |
| | number of channels in the sound sample
|
| |
| SoundSystem * | pSndSys = nullptr |
| | Sound system for which this object was created.
|
| |
| std::string | filePath |
| | File path to sound file.
|
| |
| bool | bLoop = true |
| | sound to be played in a loop?
|
| |
| float | coneDir = NAN |
| | Which direction relative to plane's heading does the cone point to? (180 would be typical for jet engines)
|
| |
| float | conePitch = NAN |
| | Which pitch does the cone point to (up/down)? (0 would be typical, ie. level with the plane)
|
| |
| float | coneInAngle = NAN |
| | Inside cone angle. This is the angle spread within which the sound is unattenuated.
|
| |
| float | coneOutAngle = NAN |
| | Outside cone angle. This is the angle spread outside of which the sound is attenuated to its SoundFile::coneOutVol.
|
| |
| float | coneOutVol = NAN |
| | Cone outside volume.
|
| |
|
| void | WavRead () |
| | Reads a WAV file into a PCM16 memory buffer, throws exceptions in case of errors.
|
| |
Represents a WAV file, read into memory, played by XP's Sound API.
◆ SoundWAV()
| 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.
◆ ~SoundWAV()
| XPMP2::SoundWAV::~SoundWAV |
( |
| ) |
|
|
override |
◆ isReady()
| bool XPMP2::SoundWAV::isReady |
( |
| ) |
|
|
inlineoverridevirtual |
Ready to play? As we load right away in the constructor we're always ready.
Implements XPMP2::SoundFile.
◆ WavRead()
| void XPMP2::SoundWAV::WavRead |
( |
| ) |
|
|
protected |
Reads a WAV file into a PCM16 memory buffer, throws exceptions in case of errors.
◆ bufferSize
| uint32_t XPMP2::SoundWAV::bufferSize = 0 |
◆ freqHz
| int XPMP2::SoundWAV::freqHz = 0 |
◆ numChannels
| int XPMP2::SoundWAV::numChannels = 0 |
number of channels in the sound sample
◆ pBuf
| int16_t* XPMP2::SoundWAV::pBuf = nullptr |
audio buffer of PCM16 data
The documentation for this class was generated from the following files: