Posts

Classical Latin text-to-speech (tts)

To master a language, it is not sufficient to learn to read it well. You must also listen to it spoken. With a dead language like Latin, that means listening to recordings. There are very few audiobooks in Latin, and still less recorded in a decent accent. So I had the idea of making my own using TTS. (Google Translate has a Latin voice, but it's actually just the Italian voice. It's useless for the restored pronunciation. It's not even useful for the ecclesiastical pronunciation of Latin.) The only option for Latin TTS is Espeak . There are two Latin voices available: the standard "la" voice and the "mbrola-la1" voice (you must install the Mbrola voice separately). The standard voice is a drunken robot, very difficult to listen to. The Mbrola voice is much better, but it has a serious incompatibility with Espeak, for which I opened a ticket on Espeak's Github page. I tried using regular expressions to rework the source text (and I discovered th

High-quality audio conferencing

Image
I've tried a lot of videoconferencing programs, including Skype and Hangouts. They all have problems, the most important of which is the crappy sound quality. I was looking for a program that would allow me to make professional-sounding interviews through the Internet. Of course there's always the option of doing a double-ender , but that requires more logistics work and some technical ability on the part of your interviewee. I figured that in the age of broadband Internet, there must be an easy way to do live high-quality audio conferences. After considerable trial and error, I finally found what I was looking for: a videoconferencing program called  Linphone . Here's what makes it so great: It uses the Opus audio codec for amazing crystal-clear audio, far better than any other codec. Skype and Hangouts sound like crap compared to this. (Of course you also need a proper microphone and recording environment.) It allows easy recording in the native format (no tra

Near real-time microphone effects (amplify, pitch, etc.)

You can increase the gain from your microphone in (almost) real-time. $ sudo apt-get install sox libsox-fmt-pulse pavucontrol $ pactl load-module module-null-sink $ sox -t pulseaudio alsa_input.usb-ZOOM_Corporation_H5_000000000000-00.multichannel-input -t pulseaudio null gain 30   Replace " alsa_input.usb-ZOOM_Corporation_H5_000000000000-00.multichannel-input" with your device, or simply default if you want to use your built-in mic. To find out the name of your input, use: $ pactl list   It will work for all kinds of other transformations, like changing the pitch of your voice: pitch -800

Create audio visualisations for Youtube

Image
Have you ever wanted to upload an audio track to Youtube, and have something visual for the listener to look at? Here's a quick and dirty way. Use GIMP to make a .png file that's 640x240, put a picture that has something to do with the audio, your channel art, whatever. Save it as test.png. Say your audio track is called test.m4a. Now run: ffmpeg -i test.png -i test.m4a -tune stillimage -filter_complex "[1:a]showfreqs=s=50x240:colors=blue[sw]; [0:v][sw]hstack[out]" -map "[out]" -map 1:a -c:v libx264 -preset fast -crf 18 -c:a copy output.mkv This will give you something like: Not exactly beautiful, but better than a blank screen.

Learn foreign languages with Python

This is a script that I wrote to help read foreign languages. I'm no programmer, so please don't make fun of me. It takes a regular text file as input, and creates a list of unique words for memory work. In fact, it creates three separate lists. The first is a list of unique words in each chapter (i.e. any block of text that starts with a number, but the criteria for identifying chapters can be easily changed). The second file is a list of unique words that occur at least twice. The third is a list of all vocabulary. import re import unicodedata def strip_accents(s):    return ''.join(c for c in unicodedata.normalize('NFD', s)                   if unicodedata.category(c) != 'Mn') source_file = open('source_.txt') out_file = open('vocab_per_chapter_sorted.txt', 'w') out_file2 = open('all_vocab_2_or_more_occurences.txt', 'w') out_file3 = open('all_vocab.txt', 'w') source_string = source_file.read(

Recording from more than once microphone in Linux

Would you like to record from two sources, for example a Skype call, to two different files? Make sure sox is installed, open a terminal: $ rec -r 44100 -c 1 file1.flac Open a new terminal tab: $ rec -r 44100 -c 1 file2.flac Using "PulseAudio Volume Control" ( pavucontrol package), choose Recording tab, select the source for each stream. To record local audio, choose Monitor…  You can open as many tabs as you like and record from as many sources as you like, if your computer can handle it.

Making screencasts in Linux

This post is just for future reference.  I figured I'd make this information available to people via Google searches. This is my current setup for screencasting. The best software I've found so far is simplescreenrecorder . Here are my settings for recording slide shows. (For recording anything fast, like video, you would need to adjust them.) This will give you LOSSLESS video and audio. Left: 0     Top: 100 Width: 854  Height: 480 Frame rate: 10 Audio input source: H5 Multichannel Separate file per segment Container: Matroska (MKV) Video Codec: H.264 Constant rate factor: 0 Preset: veryslow Allow frame skipping Audio Codec: flac Bit rate: 128 When you're finished recording, here's the editing magic: Concatenate: for f in ./*.mkv; do echo "file '$f'" >> list.txt; done ffmpeg -f concat -safe 0 -i list.txt -c copy original.mkv  Open original.mkv in Audacity: SetRMS : -22 Limiter : 0 0 -3.5 10 Noise Reduction: 12, 6,