|
Gin
|
Extracts musical metadata from audio files. More...
#include <gin_audiometadata.h>
Public Member Functions | |
| AudioMetadata (const juce::File &f, juce::AudioFormatManager &mgr) | |
| Creates an AudioMetadata object by reading metadata from an audio file. | |
Public Attributes | |
| std::optional< int > | root |
| The root note (MIDI note number 0-127). | |
| std::optional< float > | bpm |
| The tempo in beats per minute. | |
| std::optional< int > | numerator |
| Time signature numerator (beats per bar). | |
| std::optional< int > | denominator |
| Time signature denominator (beat unit). | |
| std::optional< int64_t > | loopStart |
| Loop start point in samples. | |
| std::optional< int64_t > | loopEnd |
| Loop end point in samples (exclusive). | |
Extracts musical metadata from audio files.
AudioMetadata reads loop, tempo, time signature, and root note information from WAV and AIFF files. It supports:
For files without embedded metadata, the class attempts to deduce:
All metadata fields are optional and will only be set if the corresponding data is found in the file or can be deduced.
Usage:
| AudioMetadata::AudioMetadata | ( | const juce::File & | f, |
| juce::AudioFormatManager & | mgr | ||
| ) |
Creates an AudioMetadata object by reading metadata from an audio file.
| f | The audio file to read metadata from |
| mgr | An AudioFormatManager with registered formats (call registerBasicFormats() first) |
| std::optional<int> AudioMetadata::root |
The root note (MIDI note number 0-127).
Read from ACID chunk (WAV), sampler chunk MidiUnityNote (WAV), Apple Loops basc chunk (AIFF), or deduced from filename.
| std::optional<float> AudioMetadata::bpm |
The tempo in beats per minute.
Calculated from ACID chunk beat count (WAV) or Apple Loops beat count (AIFF), or deduced from filename/cue labels.
| std::optional<int> AudioMetadata::numerator |
Time signature numerator (beats per bar).
For example, 4 in a 4/4 time signature. Read from ACID chunk (WAV) or Apple Loops basc chunk (AIFF).
| std::optional<int> AudioMetadata::denominator |
Time signature denominator (beat unit).
For example, 4 in a 4/4 time signature. Read from ACID chunk (WAV) or Apple Loops basc chunk (AIFF).
| std::optional<int64_t> AudioMetadata::loopStart |
Loop start point in samples.
Read from WAV sampler chunk (Loop0Start) or AIFF INST chunk via cue point markers.
| std::optional<int64_t> AudioMetadata::loopEnd |
Loop end point in samples (exclusive).
Read from WAV sampler chunk (Loop0End + 1) or AIFF INST chunk via cue point markers. Only set if within file length.