12 #include <unordered_map> 14 #if defined(__ANDROID__) 15 #include <aaudio/AAudio.h> 16 #elif defined(SMALL3D_IOS) 17 #include <OpenAL/al.h> 18 #include <OpenAL/alc.h> 20 #include <portaudio.h> 45 unsigned long currentFrame;
46 std::vector<char> data;
51 #if !defined(__ANDROID__) && !defined(SMALL3D_IOS) 53 #elif defined(__ANDROID__) 54 AAudioStreamBuilder *streamBuilder;
56 #elif defined(SMALL3D_IOS) 57 static ALCdevice *openalDevice;
58 static ALCcontext *openalContext;
63 static bool noOutputDevice;
65 static unsigned int numInstances;
67 #if !defined(SMALL3D_IOS) && !defined(__ANDROID__) 68 static PaDeviceIndex defaultOutput;
69 static int audioCallback(
const void *inputBuffer,
void *outputBuffer,
70 unsigned long framesPerBuffer,
71 const PaStreamCallbackTimeInfo *timeInfo,
72 PaStreamCallbackFlags statusFlags,
74 #elif defined(__ANDROID__) 75 static aaudio_data_callback_result_t audioCallback (
82 void load(
const std::string soundFilePath);
95 Sound(
const std::string soundFilePath);
106 void play(
const bool repeat=
false);
Sound()
Default constructor.
Definition: Sound.cpp:208
Sound & operator=(const Sound &other)
Copy assignment.
Definition: Sound.cpp:532
void play(const bool repeat=false)
Play the sound.
Definition: Sound.cpp:447
~Sound()
Destructor.
Definition: Sound.cpp:265
void stop()
Stop playing the sound.
Definition: Sound.cpp:488
Class that loads and plays a sound from an ogg file.
Definition: Sound.hpp:33