Tag Archives: audio

Recommended software

This post collects software around speech processing that I would recommend from personal experience.

  • Praat obviously the greatest software to do phonetics with a computer
  • Wavesurfer Built on the ashes for former esps (Xwaves) code, great software to analyse/annotate speech
  • Audacity "the" wave editor
  • sox "swiss army knife of sound conversion"
  • Sonic visualizer meant mainly for music

Record sound from microphone

This works if you got "PortAudio" on your system.

import audiofile as af
import sounddevice as sd

def record_audio(filename, seconds):
    fs = 16000
    print("recording {} ({}s) ...".format(filename, seconds))
    y = sd.rec(int(seconds * fs), samplerate=fs, channels=1)
    sd.wait()
    y = y.T
    af.write(filename, y, fs)
    print("  ... saved to {}".format(filename))