File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Lyrics of a song using Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Lyrics of a song using Java" Watch "Lyrics of a song using Java" New topic

Lyrics of a song using Java

Soumya Ghosh

Joined: Dec 31, 2006
Posts: 26
I want to build a Java Swing application which takes a song and plays that song. At that time, the lyrics of the song will be displayed in a .txt file.Lyrics will be caught from the sound of the songs. My songs are .mp3 and .wav format. How can I do that using Java? What api/plugin is needed for that purpose?

Please help me.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Wow, that sounds hard to do. The only thing I can think of is trying to integrate the Java Speech API somehow. But I'm not sure how, or even if it is possible.
[ February 05, 2007: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24166

Yes, not only hard, and not only in Java, but impossible in any language. The state of speech recognition technology is nowhere near able to recognize lyrics in music -- clear, distinct speech on a silent background is hard enough, and context-free recognition is only possible with speaker-specific training. You're talking about science fiction here

[Jess in Action][AskingGoodQuestions]
Kaustubh Patil
Ranch Hand

Joined: Aug 13, 2001
Posts: 164
If you want to do it then Flash would be a better option!!

Kaustubh. Mumbai, India.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 39547
Originally posted by Kaustubh Patil:
If you want to do it then Flash would be a better option!!

How does it make a difference whether Java or Flash are used?

Ping & DNS - updated with new look and Ping home screen widget
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
Originally posted by Ulf Dittmer:

How does it make a difference whether Java or Flash are used?

Time to failure is diminished?

Tony Morris
Java Q&A (FAQ, Trivia)
Henry Wong

Joined: Sep 28, 2004
Posts: 18113

As another option, maybe you can use the filename of your mp3 as a search criteria. I wouldn't be surprised if there is a web service somewhere that will return lyrics based on artists and/or song titles. It may not be accurate, but it is more doable.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Evan Cristofori

Joined: Feb 02, 2007
Posts: 18
What the guys said about flash... it is the way to go.

In flash you could simply import the song and then use the timeline to have your words come up in sync with the music.

Give it a try...
Guru dhaasan
Ranch Hand

Joined: Sep 13, 2006
Posts: 126

Yeah...... I too saw some of the Tamil language songs given a touch using Flash. so when the song is played the lyrics will be displayed......

Thanks, Shiv
SCJP, OCE - JSP & Servlets Developer
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Hmm. There is no capability of Flash I know of to properly recognize speach - so I can only assume the applications you have seen already had the lyrics compiled in the swf. That is unless you nkow different - If so, I'd be interested if you could post a link?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13872

Evan Cristofori: "What the guys said about flash... it is the way to go."

Guru dhaasan: "so when the song is played the lyrics will be displayed..."

You are missing the point. Soumya wrote: "Lyrics will be caught from the sound of the songs." So Soumya wants a program that can convert sound to text. This is totally impossible with current computer technology. It is impossible in Java, it is impossible in Flash, it is impossible in any programming language.

Letting the computer recognise spoken text is very difficult. Microsoft Windows Vista has this built-in, but when Microsoft did a demonstration it went totally wrong. Soumya is talking about recognising the lyrics in a song, which is even much more difficult than spoken text, because you have music in the background and the voice is constantly changing pitch and speed.

What Soumya wants is indeed science fiction as Ernest said. Come back in 50 years and ask your question again - by that time we maybe have super advanced thinking robots that can do this for you....

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Please check your PM.

My blood is tested +ve for Java.
I agree. Here's the link:
subject: Lyrics of a song using Java
Similar Threads
the internet is more hostile than ever
Am I nuts?
Comaparable And comparator
anybody here love this song ?
Most covered song ever?