Synchronizing The application with music
Right now, i am trying to write a program where i am talking in the background, and every word i say, is highlithting on the screen, to show what word i am on. So for example, say i say the sentence "The dog ran through the hoop!" Those words would already be on the screen when i said The, and each time i advance to the new word, it highlights.
The way i was going to do this was go into a music program and find the miliseconds for the start of each word i say, and put that in an array or something in my program. Then make that concurrent with another array of string values, the words. And then whenever each time elsapses, i go to the next word in the second array. I know this would work but i am saying alot of words and it would be hell trying to get everyone of those milisecond values into an array.
My question is: Does anyone know of a better way to do this? How do those people sychronize there huge OpenGL applications with the music?
Thanks
[edited by - UponTheEnd on February 28, 2004 9:18:24 AM]
Try checking the volume level from the mic, every time it goes above a threshold level (when you''re talking), advance a counter for which word you''re on and highlight it. You''ll have to speak more slowly to let the gaps between words register and trigger your counter.
Just an idea.
--
Cheers,
Just an idea.
--
Cheers,
Ooooooh, don''t go there. Stick with your milliseconds-offset unless you have a *lot* of samples, in which case make a separate helper app. to help you find the milliseconds offset. Audio processing so it works most of the time is fairly easy - audio processing so it works *all* of the time is heap-big-late-night material. If you can guarantee your samples will be clean, it *might* work, so maybe I''m being too paranoid, but I''d say that milliseconds-offset can''t break, audio processing will probably break. Feel free to prove me wrong, though (either way )
You can try inserting cues into your audio files and have your program look for them. If your program finds a cue it will increment a counter and an action will follow. Look at FMod''s sync system for more elucidation.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement