Is it easy to hack Wavesurfer to output these graphs as files of numbers?
Other alternatives? The solution needs to be open-source and/or
noncommercial if possible. Thanks.
--
Michael A. Covington - Associate Director
Artificial Intelligence Center, The University of Georgia
http://www.ai.uga.edu/~mc
package require snack
snack::sound s
# read sound file
set file ex1.wav
s read $file
# create text file with pitch values
set fd [open [file rootname $file].f0 w]
puts $fd [join [s pitch -method esps] \n]
close $fd
# create text file with power values
set fd [open [file rootname $file].pwr w]
puts $fd [join [s power] \n]
close $fd
# create text file with maximum amplitude values, one per 10ms block
set fd [open [file rootname $file].amp w]
set end 159
for {set start 0} {$start < [s length]-160} {incr start 160} {
set max [s max -start $start -end $end]
set min [s min -start $start -end $end]
if {$max > -$min} {
set out $max
} else {
set out -$min
}
puts $fd $out
incr end 160
}
close $fd
More similar examples can be found at
http://www.speech.kth.se/snack/tutorial.html, see the section on batch
processing.
WaveSurfer uses Snack internally so it can also be used to run the Snack
script above. Open the WaveSurfer console, choose File | Source... and open
the script.
It's probably easier to install Snack and use it directly though.
Hacking WaveSurfer is probably the most difficult option.
The following commands typed in the console will perform pitch extraction
set w [wsurf::GetCurrent]
set s [$w cget -sound]
puts [$s pitch]
In principle you could add a button to the WaveSurfer GUI that executes the
above statements using this statement typed on the console
pack [button .x.b3 -text hej -command [list puts [[[wsurf::GetCurrent] cget
-sound] pitch]]]
but it's probably easier use WaveSurfer's source distribution and add the
line in at the end of wavesurfer.tcl. Note that no compilation is needed.
Kare