I have a textview in which I have display the lyrics of one audio song & simultaneously i play the audio from raw folder and now I want to highlight the lyrics from textview as per the audio play. So anyone has any idea about this. I have the source code to highlight I just want to find the word palying in audio.
Asked
Active
Viewed 2,560 times
0
-
this should work for you. http://stackoverflow.com/questions/8970927/marquee-set-speed – Armaan Stranger Jul 23 '13 at 10:52
-
You've asked multiple questions like this here. I recommend reading our help center for more information on the kind of questions we expect. – Andrew Barber Jul 23 '13 at 11:13
1 Answers
1
use spannable
find the word that playing and change the color
Spannable WordtoSpan = (Spannable) tvContactName.getText();
WordtoSpan.setSpan(new BackgroundColorSpan(0xFFFFFF00), keyPos, keyPos +
LyricHighLightedText.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
tvLyric.setText(WordtoSpan);
//LyricHighLightedText means the current word that play on audio

Saeed-rz
- 1,435
- 1
- 20
- 38
-
Hi Leon_SFS, I have the highlight text code but I unable to get the single word in string which is playing currently in audio file.. So how to find that "current word that play on audio" – user2382771 Jul 23 '13 at 10:54
-
you want find out current word that play on audio dynamically? if yes. sorry i don't have experience on voice recognition :( – Saeed-rz Jul 23 '13 at 11:45
-
ok.. so how you find out that "LyricHighLightedText" in your above given code... – user2382771 Jul 23 '13 at 11:52
-
you can act like video subtitle,define lyric text file with timeline that related to audio timeline,read the text file, start timer when audio play and depend on timer time colored the current word from lyric text file – Saeed-rz Jul 23 '13 at 12:15
-
@Saeed-rz is there any sample app/source that highlights text according to playing audio. – Al-Amin Jul 23 '19 at 04:55
-
-