# File rbSnack/tkSnack.rb, line 546 def formant( options=nil, &op_block) options=SnOp::makeOps(options, &op_block) #The next 6 lines is a kludge for the fact that #Snack requires "premphasis" for formant but "premphasisfactor" for all others raise "Snack not initialized" unless @@root.type==TkRoot cmd = [@name, 'formant'] cmd = cmd+options.getTkOptionArray unless options == nil cmd = cmd.join " " cmd.sub!(/preemphasisfactor/,"preemphasis") result=@@root.tk_call ('eval', cmd) #result=Snack::exeTkCmd([@name, 'formant'], options) result=result.scan(/\{(.+?)\}/) result.collect!{ |frame| frame=frame[0].split frame.collect!{|x| x.to_f} n=frame.length/2 frame=[frame.slice(0,n), frame.slice(n,n)] } return result end