Getting lyrics from audo

I was just wondering if its possible to get the lyrics from a roblox audio from a script.

No. You will have to manually generate them or develop some sort of lyric detecting technology.

The only way to do this would be manually. Unfortunately this is extremely hard to do in the first place, even without the restraints of the small amount of sound data roblox gives us.

The only audio data roblox gives you is the peek volume, which is nowhere near enough data to patch together lyrics from a sound. You would need complex audio reading to accomplish speech recognition.

This would be really cool if it was possible though!

I’m just going to point this out -

You could make some kind of web GET request to a website if all of the lyrical content is in plaintext and all in one place.

This is true actually, but it would be quite a task.

You would need to:

  • Send a request to a custom web program

  • Have that web app steal the Audio file off the site

  • Encode and send it to a speech recognition site( if of course you can find one that works well at all )

  • Receive the response text

  • Return it to roblox

This probably would be possible using some kind of speech recognition website, but it would definitely be complicated.

I really don’t think this would work well at all with the current state of our voice processing API’s. Apps like Siri can do a halfway decent job of understanding voices, but that is without any background sounds or music.

Really glad you pointed out that that was an option though!

1 Like

No, not stealing. Web request to a custom website to read raw HTML text. That’s why I said as long as it’s all together and plaintext.

We borrow here :wink: we don’t steal.

1 Like

A song’s lyrics are not stored in it’s page HTML unless I am mistaken, so you would have to download the file off roblox’s servers, and then have the audio file get read by a separate program.

You are right that you would only need to borrow the sound file, though. Hopefully it wouldn’t be against TOS, since when you upload something to roblox you are technically open sourcing it anyway.

I also have seen multiple browser extensions allow you to download files from their pages.

Yes, it’s:

local Lyrics = Sound:GetGeneratedLyrics()

It returns a table of booleans converted to ARGB hex values.‘’

Edit: Let me know what happens, not tested,

3 Likes

Is this supposed to be lua code? I searched all over the Internet, but did not find a function with this name.

That’s not going to work. Speech to text is iffy enough when you have nice clear dictation, it can’t reliably transcribe pop music. Find some hip hop on Youtube and turn on Close Captioning, the results are often hilarious bad. The only viable solution would be to use a service that can recognize the song, together with a database of lyrics. None of this is worth doing for a Roblox game IMO, it would involve multiple services you’d have to pay for, a lot of web site work to glue it all together, and even if you got it working, it would still only work some of the time. Not the sort of thing that is likely to pay for itself on this platform.

1 Like

That’s why I originally commented it not being possible. It would be a mighty monstrous stretch to try and make something like this work consistently at all( at least with our current voice recognition NN’s ), and using a Shazam-like song recognizing program would be a pain.

1 Like

Other than possibly break tags, all of it can be grabbed from raw HTML.

Can you demonstrate how to do this? I have never been informed that this is possible.

It’s trollua.

On a serious note, the only logical way is to have a script that contains the lyrics typed manually. Then, you have to map the TimePositions in the audio to the lyrics. It can all be done by a dictionary. For example:

MyTrollSongName =
{
0 = “This is my first line in the song”,
7 = “This line is 7 seconds after the first”
}

Then you’d have an if statement as such:

local Lyrics = MyTrollSongName[Math to determine key/value to use according to TimePosition]

If you really want to look into it, you can also try some sort of HTTP request. But I’m too tired to get into that. Good luck!

1 Like

Saw this years ago, this is what I always used as a reference.

The problem is that the source of a webpage does not contain any trace of lyrics, unless they were manually inserted for some reason.

Of course you can read whatever you want from the HTML source of a page. This is only of use if it contains what you want though.

The source of the profile pages for roblox audio files, do not contain the lyrics within the audio.

Webpage parsing is useful in many cases, but this isn’t one of them unfortunately.

The point is, it’s possible, you’d probably have to mess around with some switches.

Your client does not see the real source code so it doesn’t matter if it was manually inserted or not. Your system could read raw paragraphs and text from an HTML document.

Here is an example:
image

This is pure HTML so it can be read using the example link. It doesn’t matter if someone manually put this here or not. It can still be read.