5#include "fmod_studio.h"
20 typedef std::map<std::string, FMOD_STUDIO_EVENTDESCRIPTION *>
EventMap;
21 typedef std::map<std::string, FMOD_STUDIO_BANK*>
BankMap;
40 namespace AudioEngine {
108 void loadBank(
const std::string& bankFileName, FMOD_STUDIO_LOAD_BANK_FLAGS flags = FMOD_STUDIO_LOAD_BANK_NORMAL);
FMOD_STUDIO_EVENTINSTANCE * AudioEventInstance
An audio instance equivalent to an instance of a sound. Can be start and stop. For correct 3D positio...
Definition: audioEngine.h:34
void setGlobalLabeledParameter(const std::string ¶meterName, std::string label)
Set the value of a global parameter by label.
Definition: audioEngine.cpp:352
void loadSampleData(const std::string &eventName)
Load an event's sample data, allowing for event instances to be spawned and play instantaneously....
Definition: audioEngine.cpp:197
void setLabeledParameter(AudioEventInstance instance, const std::string ¶meterName, std::string label)
Set a parameter on an event instance to a labeled value.
Definition: audioEngine.cpp:305
void releaseAllEventInstances(const std::string &eventName)
Release all event instances associated with this event.
Definition: audioEngine.cpp:265
ParameterValue getGlobalParameter(const std::string ¶meterName)
Get the value of a global parameter.
Definition: audioEngine.cpp:342
void setParameter(AudioEventInstance instance, const std::string ¶meterName, float value)
Set a parameter on an event instance.
Definition: audioEngine.cpp:285
void loadEvent(const std::string &eventName, bool loadSample)
Load an event from a loaded bank.
Definition: audioEngine.cpp:183
AudioImplementation implementation
Data used for operating the AudioEngine.
Definition: audioEngine.cpp:7
FMOD_VECTOR vectorToFmod(const glm::vec3 &vPosition)
Convert a glm vector to an fmod vector.
Definition: audioEngine.cpp:404
void set3DAttributes(AudioEventInstance instance, const EventAttributes &attributes)
Set the 3D attributes of an audio event instance.
Definition: audioEngine.cpp:389
AudioEventInstance playEvent(const std::string &eventName)
Play an event. If this event is not loaded, loadEvent will be called.
Definition: audioEngine.cpp:220
void unloadSampleData(const std::string &eventName)
Unload an event's sample data.
Definition: audioEngine.cpp:208
void stopEvent(AudioEventInstance event, bool immediate)
Stop an event that's playing.
Definition: audioEngine.cpp:246
std::string getGlobalLabeledParameter(const std::string ¶meterName)
Get the label value of a global parameter.
Definition: audioEngine.cpp:360
void unloadEvent(const std::string &eventName, bool unloadSample)
Unload an event. This effectively removes the ability to create instances of the event until it is lo...
Definition: audioEngine.cpp:274
void loadBank(const std::string &bankName, FMOD_STUDIO_LOAD_BANK_FLAGS flags)
Load a bank of audio. By default, sample data will not be loaded. It is important that both the bank ...
Definition: audioEngine.cpp:154
ParameterValue getParameter(AudioEventInstance instance, const std::string ¶meterName)
Get the value of an event.
Definition: audioEngine.cpp:294
void update()
Update the Audio Engine. Needs to be run every frame for accurate result.
Definition: audioEngine.cpp:136
AudioEventInstance createInstance(const std::string &eventName)
Create an instance of a sound event. If this event has not been loaded, loadEvent will be called.
Definition: audioEngine.cpp:227
bool init()
Initialize the Audio Engine. Must be called before any other audio operation.
Definition: audioEngine.cpp:118
const int maxChannels
Maximum channels we will use for FMOD. Usually you don't need that many (probably 4-5 would be ok).
Definition: audioEngine.h:47
void setListenerData(const EventAttributes &attributes)
Set the 3D position of the listener.
Definition: audioEngine.cpp:373
void unloadBank(const std::string &bankName)
Unload bank.
Definition: audioEngine.cpp:170
void setGlobalParameter(const std::string ¶meterName, float value)
Set a global parameter.
Definition: audioEngine.cpp:334
std::string getLabeledParameter(AudioEventInstance instance, const std::string ¶meterName)
Get the label-value of a parameter.
Definition: audioEngine.cpp:314
void releaseEvent(AudioEventInstance event)
Release an event instance. After this, the event instance is unusable.
Definition: audioEngine.cpp:256
bool release()
Release the Audio Engine. Must be called after init, and no audio operation should work after this ca...
Definition: audioEngine.cpp:144
A collection of vectors that specify an object in 3D space. This allows the AudioEngine to determine ...
Definition: audioEngine.h:59
glm::vec3 velocity
Definition: audioEngine.h:60
EventAttributes()
Construct a new Event Attributes object.
Definition: audioEngine.cpp:406
glm::vec3 position
Definition: audioEngine.h:60
glm::vec3 up
Definition: audioEngine.h:60
glm::vec3 forward
Definition: audioEngine.h:60
Value of a parameter in FMOD. Whenever a parameter is retrieved from an event (or globally),...
Definition: audioEngine.h:50
float finalValue
final value after automation, modulation, seek speed, and parameter velocity are taken into account....
Definition: audioEngine.h:55
float value
value of the parameter that's set by the API
Definition: audioEngine.h:52
Stores data for implementing the Audio Engine. This includes various maps to fmod events and banks,...
Definition: audioEngine.h:16
FMOD_STUDIO_SYSTEM * studioSystem
FMOD studio system used to interact with Fmod studio.
Definition: audioEngine.h:18
BankMap banks
Maps bank names (filename relative to run directory) to bank pointers.
Definition: audioEngine.h:24
std::map< std::string, FMOD_STUDIO_EVENTDESCRIPTION * > EventMap
Definition: audioEngine.h:20
EventMap events
Maps event names (Usually in the form: "event:/Name") as strings to event descriptions,...
Definition: audioEngine.h:26
std::map< std::string, FMOD_STUDIO_BANK * > BankMap
Definition: audioEngine.h:21