This is a script that creates verse-timings for the KJV of the Bible. It uses gently and requires that you have Docker installed.
docker pull lowerquality/gentle
docker run -P lowerquality/gentle
gem install kj
gem install mp3info
gem install faraday
ruby verse-timings.rb
ruby verse-splitter.rb
This script will of course take a very long time to run through the entire Bible. There are some gaps in verses here and there, where it will miss a verse or two, after looking at some of the output it appears to hung up on really obsure Biblical words / ethnic groups like "Jebusite."
This seemed to be working fine until it got to Psalms 119. This is the longest chapter in the Bible, and has been a bane of mine at the mnemonics project as well. At Psalm 119, Gentle seems to get stuck in some nasty loop, and eventually the connection to the server times out.
Right now, I have a hack where it just lets it time out and moves on to the next verse.
Also, I made the verse-splitter script, essentially a glorified ffmpeg call, that splits each chapter in Genesis according to the verse timings generated by Gentle. I'll extend this to cover the whole Bible once the script finishes.
Also, I may merge the verse-splitter code and verse-timings code, and I'd especially like to cut it up in such a way that you could make your own verse timings for a chapter with a single function call / command-line command. We'll see if that actually happens.
In the mean time, I'm going to try to get this working with Aeneas, in the hopes that this doesn't have the same limitations as Gentle.
I hope this code and / or the timings are helpful to you. Thank you.
TODO:
- Set this up as a proper gem (may be tricky because this requires docker and gentle to run)
- Finish running this so that it gets all the verse timings (Up to Numbers now!)
- Generalize the script so that it can run with different versions of the bible (and maybe other texts split up into verses?) and other audio files.
- Also it would probably be best if this script had options to work over individual chapters.
- It'd be cool to get all the verse timings and audio well organized in a database and wrapped into a gem, sort of like the Kj library itself, but with audio bibles, too.
- It would also be nice to straight up make a script so that, given a certain book, chapter and verse, I could just spits out the audio for a verse. In fact, I'm planning on starting that right now so that I can add sound