![]() |
Baby Language Lab Scripts
A collection of data processing tools.
|
This class contains static methods that can be used to perform some basic operations in Praat. More...
Static Public Member Functions | |
def | open_praat |
Opens a Praat instance. More... | |
def | close_praat |
Closes an open Praat instance. More... | |
def | send_commands |
Sends a list of commands to Praat. More... | |
def | get_open_clip_script |
This method returns a script that opens praat and displays a spectrograph of a given section of a given wave file. More... | |
def | get_sel_bounds_script |
Used in custom_scripts. More... | |
def | get_octave_corrected_pitch_script |
Used in Melissa's thesis project (see custom_scripts directory) More... | |
def | get_low_pass_filter_script |
This low-pass filters a clip from a wav file, and saves the clip as a new wav file. More... | |
def | get_pitch_sample_vals_script |
Used in Melissa's thesis project (see custom_scripts directory) More... | |
def | get_pitch_extrema |
Used in Melissa's thesis project (see custom_scripts directory) More... | |
def | create_serversocket |
Creates a socket to listen for info that Praat is instructed to send. More... | |
def | socket_receive |
Receives a message containing the selected boundary information from Praat. More... | |
This class contains static methods that can be used to perform some basic operations in Praat.
To do this, it uses the sendpraat program, available here. The location of this program on the current machine should be available in the constant DBConstants.SETTINGS.SENDPRAAT_PATH (which is defined in the DB settings table).
Definition at line 14 of file praat_interop.py.
|
static |
Closes an open Praat instance.
Definition at line 27 of file praat_interop.py.
|
static |
Creates a socket to listen for info that Praat is instructed to send.
To see how praat can be intructed to send info, see the get_sel_bounds_script() method.
port | (int) the port to listen on |
Definition at line 195 of file praat_interop.py.
|
static |
This low-pass filters a clip from a wav file, and saves the clip as a new wav file.
Used in relaibility project project (see custom_scripts directory)
Definition at line 115 of file praat_interop.py.
|
static |
Used in Melissa's thesis project (see custom_scripts directory)
Definition at line 91 of file praat_interop.py.
|
static |
This method returns a script that opens praat and displays a spectrograph of a given section of a given wave file.
The intention is that the user can select a portion with the mouse, and then the selection boundaries can be retreived with the close_praat() method (below).
start_time | (float) absolute start time of the clip to display |
end_time | (float) absolute end time of the clip to display |
wav_filename | (string) full path to the wave file to open |
open_spec_win | (boolean=True) set to False if you don't want to open a spectrogram window (this will just extract the sound clip) |
Definition at line 60 of file praat_interop.py.
|
static |
Used in Melissa's thesis project (see custom_scripts directory)
Definition at line 178 of file praat_interop.py.
|
static |
Used in Melissa's thesis project (see custom_scripts directory)
Definition at line 136 of file praat_interop.py.
|
static |
Used in custom_scripts.
Definition at line 74 of file praat_interop.py.
|
static |
Opens a Praat instance.
Note: Things won't work if you open more than one at a time.
Definition at line 19 of file praat_interop.py.
|
static |
Sends a list of commands to Praat.
These commands are just Strings that manipulate the Praat UI. You can access anything clickable in the UI by its name. If you need to use Praat variables to store stuff, or other Praat scripting language functions, you'll need to open an editor window. See get_sel_bounds_script() for an example of how to do that. This idea is to generate a Praat scripts for a specific task using the get_..._script() methods below. These methods return a list of strings that can be then be passed to this method for execution. This allows us to dynamically generate Praat scripts, using values or other information from our Python scripts.
cmds | (list) list of Praat commands (String). Eg. ['Open long sound file... "mysound.wav"', 'Extract part... 0.0 10.0'] |
Definition at line 39 of file praat_interop.py.
|
static |
Receives a message containing the selected boundary information from Praat.
serversocket | (socket) Python socket library socket object to receive the message on |
Definition at line 213 of file praat_interop.py.