1

我该怎么做?

  1. 声音对象被选中
  2. 将声音对象保存为 wav(作为临时文件名)
  3. 运行sox -i adsda.wavsoxi adsda.wav
  4. 输出到显示器的结果sox -i
  5. 删除临时文件
4

1 回答 1

0

You can execute sox by calling the system directive, and then capture the output in a temporary file. You can then read this temporary file into Praat with readFile$(). Here's an example:

infile$ = "sound.wav"
outfile$ = "soxi.out"
sound = Create Sound as pure tone: "tone",
  ... 1, 0, 0.4, 44100, 440, 0.2, 0.01, 0.01
Save as WAV file: infile$

system soxi 'infile$' > 'outfile$'
soxi$ = readFile$(outfile$)
appendInfo: soxi$

deleteFile: infile$
deleteFile: outfile$
removeObject: sound

I'm not sure what changes (if any) this would need in Windows, but considering you are using sox, that probably is not a problem.

Please note that currently (Praat v.5.4) the system directive still uses the old syntax, which uses variable substitution. This will probably change in the future. But this script should remain usable even then.

于 2014-11-16T05:51:10.237 回答