Praat scripting

| | Comments (0) | TrackBacks (0)

I spent a good two hours last night playing around with Praat, with some rather odd results. Praat is a phonetic analysis program, packed full of features, that I've been using for over two years now. So far, I've mainly been using it for spectrograms, annotation of files, and making measurements. However, I needed to actually manipulate some sound files, so I started playing around with the settings to see what there is on offer. There's a lot, most of it over my head - multidimensional scaling and combine to ParamCurve, anyone?

I ended up making this WAV file (right click, "save target as" to download), mostly accidentally. It was originally a recording of me saying brewed, but has been manipulated in several ways. A few of the sounds (particularly the distorted time parts) remind me of noises in a lot of breakcore music I listen to (for instance, at around 1:45 this video of Venetian Snare's Szamár Madár (yes, it's meant to sound like that)).

The particular manipulation I wanted to do, was to take a sound file, and take a particular section of that file (from, say, 25ms to 150ms), and change the duration of that section (from, say, 125ms to 100ms). Reading the manual it seemed that this was indeed possible, but to do it with any great precision would require a script. So I figured, let's write this script, and since I'm going to the trouble of writing a script I might as well make it automate most of the process for me. As such, the script will manipulate the duration between the specified time points of the selected sound file, and, optionally, write the output to a .WAV file.

This is the first Praat script I've written from scratch (I've done a few others, mainly edits of other people's work to better suit whatever I'm working on), and if you want to see it, it's here. Hopefully the comments in the code make it fairly transparent, and I think its operation is relatively simple.

Okay, technical stuff now. Look away now! Don't say I didn't warn you! Beware! ... Now that I've scared away the non-geeks, let me talk a little about the extension possibilities of this script. Currently it's fairly limited - it only outputs to WAV, for example. It should be fairly easy to change what it outputs to (or even make a range of options appear on the form). In its current form, the user has to specify the start and the end of the area to be manipulated, by entering numbers. Another (probably easier) way to do this would be to take the information from a textgrid file associated with the sound file. Then all the user has to do is to make a textgrid file, add some points where they want the duration to be changed, and run the script. Coupled with a modification that allows for batch processing of files - modifying several files in one go - this would allow for fairly extensive modification at the click of a button.

Categories

0 TrackBacks

Listed below are links to blogs that reference this entry: Praat scripting.

TrackBack URL for this entry: http://blog.r0ry.co.uk/cgi-bin/mt/mt-tb.cgi/57

Leave a comment

About this Entry

This page contains a single entry by Rory published on April 9, 2008 12:48 AM.

is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.0rc4