11 #include <RADCore/RADCore.h>
66 static std::optional<WavFile>
load(
const std::string& path, std::string* error =
nullptr);
68 static bool savePcm16(
const std::string& path, uint16_t channels, uint32_t sampleRate,
69 const std::vector<int16_t>& interleavedSamples, std::string* error =
nullptr);
82 std::vector<uint8_t> audioData_;
99 bool open(
const std::string& path, std::string* error =
nullptr);
121 std::unique_ptr<Impl> pImpl_;
319 static std::string
escape(
const std::string& value);
323 static std::string
partwiseScore(
const std::vector<MusicXmlNoteEvent>& notes,
367 static std::vector<SoundFontInfo>
scan(
const std::vector<std::string>& paths = {});
369 static std::vector<SoundFontPreset>
presets(
const std::string& path, std::string* error =
nullptr);
404 bool open(uint32_t
sampleRate = 48000,
float gain = 0.2f, std::
string* error =
nullptr);
413 bool loadSoundFont(const std::
string& path,
bool resetPresets = true, std::
string* error =
nullptr);
424 std::
string* error =
nullptr);
428 bool ensureFluidSynthLoaded(uint32_t
sampleRate,
float gain, std::
string* error);
429 std::unique_ptr<Impl> pImpl_;
438 static std::optional<AudioBuffer>
decodeFile(
const std::string& path, std::string* error =
nullptr);
457 bool open(
const std::string& path, std::string* error =
nullptr);
471 std::unique_ptr<Impl> pImpl_;
537 ssize_t
readData(
void* buffer,
size_t maxBytes)
override;
539 ssize_t
writeData(
const void* data,
size_t size)
override;
551 std::shared_ptr<Impl> pImpl_;
575 bool play(
const WavFile& wav,
const std::string& deviceId =
"default", std::string* error =
nullptr);
580 size_t framesPerChunk = 256,
unsigned int targetLatencyUsec = 5000, std::string* error =
nullptr);
582 bool playFile(
const std::string& path,
const std::string& deviceId =
"default", std::string* error =
nullptr);
591 bool playInternal(
const WavFile& wav,
const std::string& deviceId, std::string* error,
bool resetStopRequest);
592 bool playBufferInternal(
const AudioBuffer& buffer,
const std::string& deviceId,
size_t framesPerChunk,
593 unsigned int targetLatencyUsec, std::string* error,
bool resetStopRequest);
594 bool playFileInternal(
const std::string& path,
const std::string& deviceId, std::string* error,
bool resetStopRequest);
595 std::atomic<bool> stopRequested_{
false};
#define RAD_EVENT(Name, Signature)
Declares a typed RADCore event; example: RAD_EVENT(done, (int)).
Definition: RADCore.h:65
#define RADEvents
Marks a public event declaration block in RADObject-derived classes.
Definition: RADCore.h:43
RADCore task event loop with locked and low-latency scheduling strategies.
Definition: RADCore.h:956
Abstract byte-oriented IO device similar to QIODevice.
Definition: RADCore.h:1254
Base class for event receivers, senders, and thread-affinity aware objects.
Definition: RADCore.h:931
OpenMode
Open mode flags shared by RADIODevice, RADFile, and RADBuffer.
Definition: RADCore.h:293