Page 1 of 1

Ogg Vorbis And Audio Start and end Loop Tags?

Posted: Mon May 27, 2019 3:08 am
by Shadowblitz16
does anybody know if it's possible to get a tag's value from a audio source?

Re: Ogg Vorbis And Audio Start and end Loop Tags?

Posted: Mon May 27, 2019 7:14 am
by zorg
As far as i know, it's not, but you can open the file as a File object, seek into it to the proper area based on header definitions you can find on the internet, and if such tags exist, get that info out for yourself.

You should also know that Sources do not currently allow you to set loop markers either (they only support looping from beginning to end), so you will need to either use the :tell and :seek methods in your update loop yourself (testing against the two values you read out of the file) or use a Queueable Source and queue data manually, which is more work, but allows you to have the loop points be applied samplepoint-accurately.

(Alternatively i have a library for that, but currently it only works for "static" sources https://github.com/zorggn/love-asl).

Re: Ogg Vorbis And Audio Start and end Loop Tags?

Posted: Sun Jun 02, 2019 8:39 pm
by Shadowblitz16
so can getting tabs and their values be added in the future to love?
I think it would be useful since I know I can set tags in audacity when I save the file.

Re: Ogg Vorbis And Audio Start and end Loop Tags?

Posted: Mon Jun 03, 2019 5:40 am
by raidho36
I don't think this will happen. You can however export the looping points as text and then load it in the game.

Re: Ogg Vorbis And Audio Start and end Loop Tags?

Posted: Mon Jun 03, 2019 7:47 am
by zorg
Simple answer is no, because you'd need to add in such functionalities to -all other- supported sound formats as well, to keep consistency between them; mp3 files afaik only have reliable loop points if they are LAME-encoded, and have such tags in them; wav also support loop point metadata, but code for all these must be written (if the import libs don't have them yet, and my guess is they don't).

And then you have module files; from a naive standpoint, they are the easiest to loop since the lib löve uses could handle such a thing... except it's, again for consistency reasons, treated like any of the other bitstream formats, so it would depend on libmodplug whether rendering the song would adhere to the loop points or not (in streamed mode, it might work, in static mode... it may crash löve)