Skip to content

peterzukerman/Python-PitchContour

Repository files navigation

Pitch Contour

Parselmouth - Praat in Python

Parselmouth is a Python library for the Praat software. Here I use it for generating 4 types of modifications:

  1. Volume (dB +-)
  2. Pitch (sets entire audio pitch to x Hz)
  3. Noise (overlays noise based on SNR)
  4. Pitch Contour (changes tone)

Installation

pip install praat-parselmouth

Libraries used

import json
import os
import sys
import shutil
import numpy as np
import wave
import parselmouth
import glob
from parselmouth.praat import call
from pydub import AudioSegment

Documentation

openFile(jsonPath, filePath)

Loads in json files (with start and end times of speech) and the path to the audio files. Returns a 2d array in the format [jsonFiles, samples], where jsonFiles is an array of json objects, and samples is an array of pydub AudioSegments.

openModifiers(path)

Loads in noise that will be overlayed on the samples. Returns an array of AudioSegments.

adjustVolume(sample, decibels)

Adjusts sample volume by decibels. Positive or negative.

adjustPitch(wavPath, pitch)

Creates a pitchTier with a pitchPoint at the given pitch, and resynthesis the wav (from wavPath) based on the pitchTier. Saves the new sound in the format

("pitch{}.wav".format(" " + str(pitch) + "Hz"), 'WAV')

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages