|
typedef XPLM_API FMOD_CHANNEL *() | XPMP2::f_XPLMPlayPCMOnBus(void *audioBuffer, uint32_t bufferSize, FMOD_SOUND_FORMAT soundFormat, int freqHz, int numChannels, int loop, XPLMAudioBus audioType, XPLMPCMComplete_f inCallback, void *inRefcon) |
|
typedef XPLM_API FMOD_RESULT() | XPMP2::f_XPLMStopAudio(FMOD_CHANNEL *fmod_channel) |
|
typedef XPLM_API FMOD_RESULT() | XPMP2::f_XPLMSetAudioPosition(FMOD_CHANNEL *fmod_channel, FMOD_VECTOR *position, FMOD_VECTOR *velocity) |
|
typedef XPLM_API FMOD_RESULT() | XPMP2::f_XPLMSetAudioFadeDistance(FMOD_CHANNEL *fmod_channel, float min_fade_distance, float max_fade_distance) |
|
typedef XPLM_API FMOD_RESULT() | XPMP2::f_XPLMSetAudioVolume(FMOD_CHANNEL *fmod_channel, float source_volume) |
|
typedef XPLM_API FMOD_RESULT() | XPMP2::f_XPLMSetAudioCone(FMOD_CHANNEL *fmod_channel, float inside_angle, float outside_angle, float outside_volume, FMOD_VECTOR *orientation) |
|
|
FMOD_VECTOR | XPMP2::FmodHeadPitch2Vec (const float head, const float pitch) |
| Convert heading/pitch to normalized x/y/z vector. More...
|
|
bool | XPMP2::XPSoundIsAvail () |
| Are XP12 sound functions available? More...
|
|
bool | XPMP2::XPSoundLoadFctPtr () |
| Tries to find all the new XP12 sound functions, available as of XP12.04. More...
|
|
int | XPMP2::SoundLoadXPSounds () |
| Load fixed set of X-Plane-internal sounds. More...
|
|
const char * | XPMP2::SoundEventTxt (Aircraft::SoundEventsTy e) |
| Return a text for the values of Aircraft::SoundEventsTy. More...
|
|
void | XPMP2::FmodHeadPitchRoll2Normal (const float head, const float pitch, const float roll, FMOD_VECTOR &vecDir, FMOD_VECTOR &vecNorm) |
| Convert heading/pitch to normal x/y/z vector. More...
|
|
void | XPMP2::FmodNormalizeHeadingPitch (float &head, float &pitch) |
| Normalize Pitch/Heading. More...
|
|
void | XPMP2::SoundInit () |
| Initialize the sound module and load the sounds. More...
|
|
void | XPMP2::SoundUpdatesBegin () |
| Prepare for this frame's updates, which are about to start. More...
|
|
void | XPMP2::SoundUpdatesDone () |
| Tell FMOD that all updates are done. More...
|
|
void | XPMP2::SoundCleanup () |
| Graceful shoutdown. More...
|
|
bool | XPMPSoundEnable (bool bEnable) |
| Enable/Disable Sound. More...
|
|
bool | XPMPSoundIsEnabled () |
| Is Sound enabled? More...
|
|
void | XPMPSoundSetMasterVolume (float fVol) |
| Set Master Volume. More...
|
|
void | XPMPSoundMute (bool bMute) |
| Mute all sounds (temporarily) More...
|
|
const char * | XPMPSoundAdd (const char *sName, const char *filePath, bool bLoop, float coneDir, float conePitch, float coneInAngle, float coneOutAngle, float coneOutVol) |
| Add a sound that can later be referenced from an XPMP2::Aircraft. More...
|
|
const char * | XPMPSoundEnumerate (const char *prevName, const char **ppFilePath) |
| Enumerate all sounds, including the internal ones. More...
|
|
Sound for aircraft.
Sound for aircraft, based on the FMOD library.
As of X-Plane 12.04, X-Plane's SDK offers an interface into X-Plane's FMOD system. If available these functions are loaded dynamically (to stay compatible to XP11). If not available then either FMOD can be used directly if built including FMOD (see SoundFMOD.cpp) or no sound is available.
- Author
- Birger Hoppe
- Copyright
- (c) 2022 Birger Hoppe
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Note
- If built with
INCLUDE_FMOD_SOUND=1
then Audio Engine is FMOD Core API by Firelight Technologies Pty Ltd. Understand FMOD licensing and attribution requirements first!
- See also
- FMOD Core API Guide https://fmod.com/docs/2.02/api/core-guide.html
FMOD's C interface is used exclusively (and not the C++ ABI). This is to ease handling of dynamic libaries between versions (XP11 is using FMOD 1.x while XP12 has upgraded to 2.x) and allows compiling with MingW.
Some functionality looks like immitating FMOD's SoundGroup, but 3D positioning was unstable when used via SoundGroup, and the cone functionality did not work at all, so this file handles all sound channels individually.
- Note
- If linking to the logging version of the FMOD API library (the one ending in
L
) and specifying a config item log_level
of 0 = Debug
(see XPMPIntPrefsFuncTy) while initializing sound, ie. typically during the first call to XPMPMultiplayerInit(), then FMOD logging output is added to X-Plane's Log.txt
.
- Author
- Birger Hoppe
- Copyright
- (c) 2022 Birger Hoppe
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.