How to get info from an Ogg file?

How to get info from an Ogg file?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

How to get info from an Ogg file?

Post by Forboding Angel »

Specifically I want to get title and artist. I have found some random sparse info on where others have tried to do it, but doesn't work. I know that smoth at one point had a music widget that did it.

Info also doesn't seem to be in the wiki.

Code: Select all

	-- for key, val in pairs(oggInfo) do
		-- Spring.Echo(key, val)
	-- end


	-- if (oggInfo.comments.TITLE and oggInfo.comments.TITLE) then
		-- Spring.Echo("Song changed to: " .. oggInfo.comments.TITLE .. " By: " .. oggInfo.comments.ARTIST)
	-- else
		-- Spring.Echo("Song changed but unable to get the artist and title info")
	-- end
Here is the code block I found where someone was trying to do it.
hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

Re: How to get info from an Ogg file?

Post by hokomoko »

I don't think a way exists at the moment
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: How to get info from an Ogg file?

Post by Silentwings »

Use filenames in "Artist - Title" form instead.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: How to get info from an Ogg file?

Post by Forboding Angel »

Thanks guys :-)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: How to get info from an Ogg file?

Post by smoth »

Forb, that code still works on my end

edit

yep, still works, maybe it is an issue with your ogg info somehow being malformed, care to email them to me or a link to them?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: How to get info from an Ogg file?

Post by Forboding Angel »

Can you paste your widget so I can see how it's being done?

https://github.com/EvolutionRTS/Evoluti ... _Evo/Music

Image
Post Reply

Return to “Game Development”