Convert WebVTT subtitles files into Akoma Ntoso transcripts.
Ruby 2.3.1 recommended, then:
gem install vtt2an
or add to your Gemfile:
gem "vtt2an"
and then
bundle
Load a WebVTT file using webvtt-ruby, then convert it using Vtt2An::Converter
to a REXML::Document
in Akoma Ntoso format:
webvtt = WebVTT.read "in.wtt"
converter = Vtt2An::Converter.new webvtt
output = converter.convert
File.open("out.an", "w") do |f|
output.write f
end
If you just want to convert files, you can use the handy command-line tool:
bundle exec exe/vtt2an.rb /path/to/file.vtt /path/to/output.an