YourGameLib
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
audio.cpp File Reference
#include <string>
#include <map>
#include <cmath>
#include <cstdint>
#include <vector>
#include <valarray>
#include "yourgame/file.h"
#include "yourgame/log.h"
#include "stb_vorbis.c"
#include "miniaudio.h"
Include dependency graph for audio.cpp:

Namespaces

namespace  yourgame
 
namespace  yourgame::audio
 audio playback related functions
 

Macros

#define STB_VORBIS_HEADER_ONLY
 

Functions

int yourgame::audio::init (int numSources, int numChannels=0, int sampleRate=0)
 initialize audio
 
void yourgame::audio::shutdown ()
 shutdown audio
 
bool yourgame::audio::isInitialized ()
 check if audio initialized
 
int yourgame::audio::storeFile (const std::string &filename)
 load and store audio file
 
int yourgame::audio::play (const std::string &filename, bool loop=false)
 play audio file, that was previously loaded via storeFile()
 
int yourgame::audio::stop (int sourceId)
 stop audio source
 
int yourgame::audio::pause (int sourceId, bool pause)
 pause/unpause audio source
 
int yourgame::audio::setChannelGains (int sourceId, const std::vector< float > &gains)
 set gain per channel of an audio source
 

Macro Definition Documentation

◆ STB_VORBIS_HEADER_ONLY

#define STB_VORBIS_HEADER_ONLY

Variable Documentation

◆ channelGains

std::vector<float> channelGains

◆ decoder

ma_decoder decoder

◆ loop

bool loop = false

◆ paused

bool paused = false