Is there a way to highlight a text in corona while an audio is being played?Basically what I want is to highlight the text when the audio file is played. [import]uid: 82446 topic_id: 17201 reply_id: 317201[/import]
you want something like karaoke, you can…
have you seen .srt files? Sub Titles used on VLC. these are the dialogues that are sub-titled on the video based on their time. So get the timing of your audio and place the text based on that time.
cheers,
? [import]uid: 3826 topic_id: 17201 reply_id: 64867[/import]
try:
http://developer.anscamobile.com/code/soundtextsync-read-it-me-story-books-and-interactive-text [import]uid: 60707 topic_id: 17201 reply_id: 64888[/import]
This is just awesome…but how to pause the “highlighting the text” function on pressing the pause button.coz when i press the pause button the audio is paused but the Highlighter moves on.Can anybody help me regarding this as I am unable to assume how to do that? [import]uid: 82446 topic_id: 17201 reply_id: 65885[/import]
Please somebody help me pausing the text highlighting on pause button function…Can anybody help me out pleaseee? [import]uid: 82446 topic_id: 17201 reply_id: 66457[/import]
I don’t have time to fix the code for you at the moment, but you want to focus on this block of code:
[code]
local function saySentence(event)
local delay1, delay2, trans1, trans2 = 0,0,200,400
media.playSound(“1.caf”)
– switch to red button so it’s not touchable
transition.dissolve(blackButton,redButton,trans1,0)
transition.dissolve(redButton,blackButton,trans1,soundLength+trans2)
for i = 1,#voice do
– start transition early so it’s full red by the time the word is spoken
delay1 = voice[i].start*1000 - trans1
if delay1 <0 then delay1 = 0 end
– add extra time at the end so we never finish before the fade is complete
delay2 = voice[i].out*1000 + trans2
transition.dissolve(blackText[i],redText[i],trans1,delay1)
transition.dissolve(redText[i],blackText[i],trans2,delay2)
end
end[/code]
Your going to need to store the transitions in a table. When the pause button is pressed, simply cancel the transitions in your table. http://developer.anscamobile.com/reference/index/transitioncancel
When the resume button is pressed you’ll have to deal with how to restart things. It’s probably easiest just to call saySentance again instead of trying to pick-up where you left off.
Good luck!
[import]uid: 60707 topic_id: 17201 reply_id: 66496[/import]