Text to speech synched to video
revdev at pdslabs.net
Tue Nov 17 01:15:06 CST 2009
Conceptually this isn't hard at all. Here's how it could work:
1. Create a callback list for the movie. (Look up "callbacks" in the
docs. "The callbacks" is a player property.) A callback list is a
set of lines where each line contains two items: a movie time
reference and the name of the handler to be called at that time.
2. Organize your text so each "read segment" is on a line by itself.
3. Create a handler to be called by the callbacks, that uses the
"revSpeak" command to read the next line of a set of text lines.
Here's some "prototype" code (not tested, probably over-simplified):
The "callbacks" player property:
I'm assuming the text to be read is brought into a local variable before
the movie starts. Because of that, all the following code should be in
the same script:
-- start of code ------------
put the uMovieText of this stack into vMovieText
revSpeak line 1 of vMovieText
wait until revIsSpeaking() = false with messages
delete line 1 of vMovieText
-- end of code -------------
I think that's about all you would need if you do it this way, and there
are no doubt other ways. At any rate it gives you a starting point.
revolution at duncansoftware.on-rev.com wrote:
> I need to have a text file read using the system's text to speech engine
> and have it synched to a video. No talking heads just description of the
> activity in the video but there would be periods where no speech is
> required, in other words, intermitent speech timed to the video. Along the
> lines of the old text tracks in QuickTime but what I want is speech
> tracks. Does such a thing exist? Anyone have any ideas on how I might go
> about accomplishing this? To complicate things it needs to run on
> Windows, and OSX. Linux would be nice but not critical.
Professional Software Development
More information about the use-livecode