Highlighting words as they are spoken

tommy15979tommy15979 Member Posts: 4
edited March 2012 in Working with GS (Mac)
I'm working on a story book for kids. One option is for the user have the book read to them. I can get the voice over created just fine, but is there a way to highlight each word as it is spoken? It seems that I'll have to create an actor for each word for the highlight effect, but is there an easy way to sync that with the spoken words?

Answers

  • akichan22akichan22 Member Posts: 9
    i think the simple way is to use same actor that you spawn, and them change the width with a rule and a timer. You create an attribute (for example: word.width) that you change it before the spawn and put in the highlight actor a rule where self.width = word.width*(depend on the size of the word)
    No idea for the sync. srry
  • simo103simo103 Member, PRO Posts: 1,331
    edited March 2012
    @tommy15979 ... off the top of my head I would try a different approach .... would take quite a bit of effort but would save resources I believe. Create a highlight actor (opacity set to see thru) and place it on the first word. Open it in the scene and write down the x and y values and width. Move it to the next word and size, open and write down the x and y and width etc, etc. Then I would test and write down the timing with a stop watch and put that value in the table also. So each row would have the x, y, width and timing. Then put the rules in the highlight actor to use those values to move, size and at what interval. (Since its a kids book .. I'm assuming its not 1,000s of words so you might consider it)?
  • old_kipperold_kipper Member Posts: 1,420
    I have done this with changing the transparency of the word (against a white background) based on timers to take the word up to full opacity (highlighted), and then back to a 50% using the next timer. The times I've sorted out by making a list from within Audacity. I have also made it so it the child presses the word it speaks the word. This needed a second set of recordings (one for each word) as is close to impossible to separate the words out for a continuous reading. It takes quite a lot of set up but once you have one page done the substitution of the content for more pages is much faster. When laying the page out it's worth putting an image of the full text behind so you can accurately position the individual words/actors.

    hope that helps. Kipper
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2012
    If you have isolated the words in sound files, you can use a table to "read" through the sentences. You'd need a loop/timer to "read" through the sounds in order. I would set up a table with your full sentence using one word per row or column. With each iteration (each word), change the value of game.WordToSpeak to the next word in the row or column. Name the sound files with the actual word (e.g. "upon").

    You could then use a single actor as a word placeholder. Copy the actor as many times as you have words on the screen. Name each actor the exact word you want to show (e.g. "Once upon a time" would need four actors named 'Once', 'upon', 'a', and 'time'). You can re-used words (e.g. if 'a' comes up on another page, you don't need a new actor). In the actor's rules, add a rule that says when game.WordToSpeak is self.name then [play sound with name game.WordToSpeak] and [display text game.WordToSpeak with yellow color] otherwise [display text game.WordToSpeak with black color]. This of course assumes you're using the built-in fonts. You could do this just as easily with images named the exact word.

    Here's a quick demo I threw together: http://dl.dropbox.com/u/19602014/Read To Me.zip

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tommy15979tommy15979 Member Posts: 4
    I would like to thank everyone for the support
  • krustelkramkrustelkram Member Posts: 19
    wow @tatiang that's a super cool demo. Thank you! I just wish it wouldn't sound so weird having stops between every word. It's okay for a very short sentence (or better just a word) but if it's more it starts to be too mechanic. Did you by any chance figure out a new way of doing this during the last year?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    wow @tatiang that's a super cool demo. Thank you! I just wish it wouldn't sound so weird having stops between every word. It's okay for a very short sentence (or better just a word) but if it's more it starts to be too mechanic. Did you by any chance figure out a new way of doing this during the last year?
    Can't say I've looked at it since then. And yes, the demo's pretty choppy sounding and far from natural.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.