Ogg Vorbis And Audio Start and end Loop Tags?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Shadowblitz16
Citizen
Posts: 73
Joined: Wed Oct 28, 2015 11:18 pm

Ogg Vorbis And Audio Start and end Loop Tags?

Post by Shadowblitz16 »

does anybody know if it's possible to get a tag's value from a audio source?
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post 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).
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Shadowblitz16
Citizen
Posts: 73
Joined: Wed Oct 28, 2015 11:18 pm

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

Post 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.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post 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.
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post 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)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests