|
RADLib
RADical C++ application framework
|
RADMedia currently focuses on audio: WAV parsing and streaming, ALSA device enumeration and I/O, whole-file and streaming decoding, playback, MIDI input, and a lightweight MIDI preview renderer with MusicXML score export. WAV and raw PCM are the primary stable paths; compressed codecs and the synth backend depend on installed system libraries.
WAV files are described by WavFormat (channels, sample rate, bits, and an AudioSampleFormat such as Int16 or Float32). WavFile loads a whole file via load() and writes 16-bit PCM via savePcm16(), while WavStreamReader parses the header and reads frames incrementally with readFrames(). AudioBuffer holds interleaved Float32 samples.
Device I/O centers on RADAudioDevice, an ALSA-backed RADCore::RADIODevice constructed with an EventLoop and an AudioDeviceDirection (Input or Output). It raises started, stopped, and underrun events, exposes readData()/writeData()/writeFrames(), and tunes latency through setFramesPerChunk(), setTargetLatencyUsec(), setPeriodFrames(), and setBufferFrames(). AudioInputDevice is an input-only convenience subclass. AudioDevice::outputDevices() and inputDevices() enumerate ALSA endpoints.
AudioPlayer is a RADCore::RADObject for playback, offering synchronous play(), playBuffer(), and playFile() plus async playAsync() and playFileAsync(), and it emits started, finished, stopped, and errorOccurred. AudioDecoder and AudioDecoderStream decode compressed files into Float32 buffers.
For MIDI, MidiInputDevice reads decoded MidiMessage values from ALSA raw-MIDI hardware. MidiClip schedules MidiNoteEvent, MidiProgramChange, and MidiPitchBend events, which MidiSynthesizer renders to an AudioBuffer via render(), renderClip(), or streaming beginStream()/renderNext(). SoundFontCatalog discovers .sf2/.sf3 files and their presets, and MusicXml::partwiseScore() exports MusicXmlNoteEvent data as MusicXML 3.1.
Core features:
WavFile) and streaming (WavStreamReader).RADIODevice input/output via RADAudioDevice.AudioPlayer.AudioDecoder, AudioDecoderStream).Example: