Basically: Is there a way to check the properties of an ogg file with C#... Especially the loop timecode is what i want to read.
Asked
Active
Viewed 717 times
-3
-
Are you just extracting information, or are you playing the file in c# as well? If you are, what library are you using to decode? – gnud May 15 '18 at 19:22
-
There's not enough detail in the question to know if you want to read just tags or properties of the audio, too (in which case, possible duplicate of [Using .NET to detect .ogg file properties? Number of channels, bits per channel, sample rate?](https://stackoverflow.com/questions/8668767/using-net-to-detect-ogg-file-properties-number-of-channels-bits-per-channel)). – Lance U. Matthews May 15 '18 at 19:54
1 Answers
2
If you are using LOOPSTART
and LOOPEND
metadata, as suggested here, or LOOPSTART
and LOOPLENGTH
, as suggested here, these are saved as comments
in the audio file.
Using NVorbis (also on Nuget), you can read the comments like this:
using(var f = new VorbisReader(@"c:\myloop.ogg")) {
foreach(var c in f.Comments) {
Console.WriteLine(c);
}
}
Your output will look like
LOOPSTART=0
TITLE=My title
DATE=2018
LOOPEND=26508
ARTIST=Artist name

gnud
- 77,584
- 5
- 64
- 78
-
This technicaly works, but it seems the ogg files in my specific case don't have the LOOP comments, even though they do loop. Can it be that the loop is stored somewhere else in the oggfile and that this can be found via the VorbisReader? – DesMondesBlut May 22 '18 at 07:27
-