mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-24 01:54:22 +00:00
Added some metadata reading to OggVorbisAudioFormat
This commit is contained in:
parent
c58d91fc04
commit
85568915dc
1 changed files with 17 additions and 0 deletions
|
|
@ -124,6 +124,17 @@ public:
|
|||
if (err == 0)
|
||||
{
|
||||
vorbis_info* info = ov_info (&ovFile, -1);
|
||||
|
||||
vorbis_comment* const comment = ov_comment (&ovFile, -1);
|
||||
addMetadataItem (comment, "ENCODER", OggVorbisAudioFormat::encoderName);
|
||||
addMetadataItem (comment, "TITLE", OggVorbisAudioFormat::id3title);
|
||||
addMetadataItem (comment, "ARTIST", OggVorbisAudioFormat::id3artist);
|
||||
addMetadataItem (comment, "ALBUM", OggVorbisAudioFormat::id3album);
|
||||
addMetadataItem (comment, "COMMENT", OggVorbisAudioFormat::id3comment);
|
||||
addMetadataItem (comment, "DATE", OggVorbisAudioFormat::id3date);
|
||||
addMetadataItem (comment, "GENRE", OggVorbisAudioFormat::id3genre);
|
||||
addMetadataItem (comment, "TRACKNUMBER", OggVorbisAudioFormat::id3trackNumber);
|
||||
|
||||
lengthInSamples = (uint32) ov_pcm_total (&ovFile, -1);
|
||||
numChannels = (unsigned int) info->channels;
|
||||
bitsPerSample = 16;
|
||||
|
|
@ -139,6 +150,12 @@ public:
|
|||
OggVorbisNamespace::ov_clear (&ovFile);
|
||||
}
|
||||
|
||||
void addMetadataItem (OggVorbisNamespace::vorbis_comment* comment, const char* name, const char* metadataName)
|
||||
{
|
||||
if (const char* value = vorbis_comment_query (comment, name, 0))
|
||||
metadataValues.set (metadataName, value);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
|
||||
int64 startSampleInFile, int numSamples) override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue