Safe Haskell | None |
---|---|
Language | Haskell2010 |
Reanimate can automatically synchronize animations to your voice if you have a transcript and an audio recording. This works with the help of Gentle (https://lowerquality.com/gentle/). Accuracy is not perfect but it is pretty close, and it is by far the easiest way of adding narration to an animation.
Synopsis
- data Transcript = Transcript {
- transcriptText :: Text
- transcriptKeys :: Map Text Int
- transcriptWords :: [TWord]
- data TWord = TWord {
- wordAligned :: Text
- wordCase :: Text
- wordStart :: Double
- wordStartOffset :: Int
- wordEnd :: Double
- wordEndOffset :: Int
- wordPhones :: [Phone]
- wordReference :: Text
- data Phone = Phone {
- phoneDuration :: Double
- phoneType :: Text
- findWord :: Transcript -> [Text] -> Text -> TWord
- findWords :: Transcript -> [Text] -> Text -> [TWord]
- loadTranscript :: FilePath -> Transcript
- fakeTranscript :: Text -> Transcript
- splitTranscript :: Transcript -> [(SVG, TWord)]
- annotateWithTranscript :: Transcript -> Scene s ()
Documentation
data Transcript Source #
Aligned transcript. Contains the transcript text as well as timing data for each word.
Transcript | |
|
Instances
Show Transcript Source # | |
Defined in Reanimate.Voice showsPrec :: Int -> Transcript -> ShowS # show :: Transcript -> String # showList :: [Transcript] -> ShowS # | |
FromJSON Transcript Source # | |
Defined in Reanimate.Voice parseJSON :: Value -> Parser Transcript # parseJSONList :: Value -> Parser [Transcript] # |
Spoken word. Includes information about when it was spoken, its duration, and its phonemes.
TWord | |
|
Phoneme type
Phone | |
|
findWord :: Transcript -> [Text] -> Text -> TWord Source #
Locate the first word that occurs after all the given keys. An error is thrown if no such word exists. An error is thrown if the keys do not exist in the transcript.
findWords :: Transcript -> [Text] -> Text -> [TWord] Source #
Locate all words that occur after all the given keys. May return an empty list. An error is thrown if the keys do not exist in the transcript.
loadTranscript :: FilePath -> Transcript Source #
Loading a transcript does three things depending on which files are available with the same basename as the input argument: 1. If a JSON file is available, it is parsed and returned. 2. If an audio file is available, reanimate tries to align it by calling out to Gentle on localhost:8765/. If Gentle is not running, an error will be thrown. 3. If only the text transcript is available, a fake transcript is returned, with timings roughly at 120 words per minute.
fakeTranscript :: Text -> Transcript Source #
Fake transcript timings at roughly 120 words per minute.
splitTranscript :: Transcript -> [(SVG, TWord)] Source #
Convert the transcript text to an SVG image using LaTeX and associate each word image with its timing information.
annotateWithTranscript :: Transcript -> Scene s () Source #
Helper function for rendering a transcript.