Topics

two selections from one sound file

Gareth Walker <gw115@...>
 

Dear all,
 
I am trying to write a Praat script which includes the extraction of two different selections from a single sound file.  Can anyone help me do this?  For reference, the closest I can get is this:
 
######################
Extract selection
endeditor
Rename... sound1
 
select Sound foo
 
pause
 
Extract selection
endeditor
Rename... sound2
######################
 
It pauses after the first extraction and renaming, and allows the second selection in the SoundEditor to be made but will not extract...
 
Many thanks,
 
Gareth Walker
 
Department of Language and Linguistic Science
University of York
Heslington
York
YO10 5DD

ajowen_98@...
 

I am not sure if this directly answers your question, but it might
point in the right direction... I had several items in a soundfile
with the same name and wanted to extract them all and concatenate them
into one file. I used the following as a means to do that (I am not
sure it is the most efficient way, but perhaps using the variables
as a means to consistently select the sound wouold help?
__________________________
form extract
word textgrid
word sound
real tier
sentence stimulus
endform
# where textgrid and sound are the file names of the files open in the
editor
# where tier means the number of the tier to be extracted from
# where stimulus means the actual input on the texttier which the
extract program is looking for.


select TextGrid 'textgrid$'
plus Sound 'sound$'
Extract intervals... 'tier' yes 'stimulus$'
Concatenate
Rename... 'stimulus$'chain
Write to WAV file... C:&#92;...&#92;'stimulus$'chain.wav
___________________________
Amanda
ajowen@...



--- In praat-users@y..., "Gareth Walker" <gw115@y...> wrote:
Dear all,

I am trying to write a Praat script which includes the extraction of
two different selections from a single sound file. Can anyone help me
do this? For reference, the closest I can get is this:

######################
Extract selection
endeditor
Rename... sound1

select Sound foo

pause

Extract selection
endeditor
Rename... sound2
######################

It pauses after the first extraction and renaming, and allows the
second selection in the SoundEditor to be made but will not extract...

Many thanks,

Gareth Walker

Department of Language and Linguistic Science
University of York
Heslington
York
YO10 5DD

Neil Coffey <Neil.Coffey@...>
 

On Tue, 10 Jul 2001, Gareth Walker wrote:

I am trying to write a Praat script which includes the extraction of two different selections from a single sound file.
Can anyone help me do this?
Garenth,

The way I normally extract a selection from a file is
something like:

select Sound S1-C
Edit
editor Sound S1-C
Move B to... 0.5
Move E to... 0.9
Extract selection
Close
endeditor

If you want to extract two different sections, then
you do this twice. Or is there something else you
want to do, like concatenate the two selections?

Neil
P.S. Aren't you supposed to be on holiday?

Paul Boersma <paul.boersma@...>
 

Neil Coffey wrote:

select Sound S1-C
Edit
editor Sound S1-C
Move B to... 0.5
Move E to... 0.9
Extract selection
Close
endeditor
this is overly laborious. One rarely has to script an editor,
unless the script has to react to cursors or selections set by the user.
The following is much shorter, and does the same:

select Sound S1-C
Extract part... 0.5 0.9 Rectangular 1.0 no

--

Paul Boersma
Institute of Phonetic Sciences, University of Amsterdam
Herengracht 338, 1016CG Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/
phone +31-20-5252385