13#define PA_THROW_CHECK(expr, msg) \
16 if (err != paNoError) \
18 throw std::runtime_error(std::string("Portaudio: ") + msg + " (" + std::string(Pa_GetErrorText(err)) + ")"); \
22#define PA_WARNING_CHECK(expr, msg) \
25 if (err != paNoError) \
27 LOG_WARNING(std::string("Portaudio: ") + msg + " (" + std::string(Pa_GetErrorText(err)) + ")"); \
53 PaStream *m_stream =
nullptr;
55 std::vector<std::unique_ptr<Data>> m_audio_datas;
57 std::mutex m_sound_instances_mutex;
58 std::vector<Instance> m_sound_instances;
61 const void *inputBuffer,
63 unsigned long framesPerBuffer,
64 const PaStreamCallbackTimeInfo *timeInfo,
65 PaStreamCallbackFlags statusFlags,
SoundName
Definition: SoundList.hpp:14
Definition: AudioData.hpp:12
Definition: SoundEngine.hpp:42
friend int paCallback_stereo(const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData)
Definition: SoundEngine.cpp:6
Engine()
Definition: SoundEngine.cpp:69
~Engine()
Definition: SoundEngine.cpp:111
void playSound(const SoundName audio_index, bool loop=false)
Definition: SoundEngine.cpp:118
Definition: AudioData.cpp:7
Definition: SoundEngine.hpp:34
Data * audio_data
Definition: SoundEngine.hpp:35
bool ended
Definition: SoundEngine.hpp:38
bool loop
Definition: SoundEngine.hpp:37
uint32_t cursor
Definition: SoundEngine.hpp:36