File: formant.test

package info (click to toggle)
snack 2.2.10-dfsg1-12.1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,024 kB
  • sloc: ansic: 35,473; sh: 8,557; tcl: 1,065; python: 701; makefile: 565
file content (62 lines) | stat: -rw-r--r-- 1,746 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Commands covered: sound formant
#

package require -exact snack 2.2

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import ::tcltest::*
}

test formant-1.1 {formant command} {
  set s [snack::sound snd -load ex1.wav]
  set tcl_precision 5
  set res [lindex [$s formant -framelength 0.01 -preemphasis 0.7 -numformants 4  -lpcorder 12 -windowlength .049 -lpctype 0 -ds_freq 10000.0 -nom_f1_freq -10.0] end]
  $s destroy
  set res
} {102.23 2077.6 2951.1 3818.2 734.88 480.1 532.49 588.74}

test formant-1.2 {formant command} {
  set s [snack::sound snd -load ex1.wav]
  set tcl_precision 5
  set res [lindex [$s formant] end]
  $s destroy
  set res
} {102.23 2077.6 2951.1 3818.2 734.88 480.1 532.49 588.74}

test formant-1.3 {formant command} {
  set s [snack::sound snd -load ex1.wav]
  set tcl_precision 5
  set res [lindex [$s formant -windowtype 2] end]
  $s destroy
  set res
} {102.23 2077.6 2951.1 3818.2 734.88 480.1 532.49 588.74}

test formant-1.4 {formant command} {
  set s [snack::sound snd -load ex1.wav]
  set tcl_precision 5
  set res [lindex [$s formant -windowtype cos^4] end]
  $s destroy
  set res
} {102.23 2077.6 2951.1 3818.2 734.88 480.1 532.49 588.74}

test formant-1.5 {formant command} {
  set s [snack::sound snd -load ex1.wav]
  set tcl_precision 5
  set res [lindex [$s formant -windowtype 0] end]
  $s destroy
  set res
} {151.71 1265.8 2097.1 2948.0 651.9 693.92 580.95 513.44}

test formant-1.6 {formant command} {
  set s [snack::sound snd -load ex1.wav]
  set tcl_precision 5
  set res [lindex [$s formant -windowtype rectangular] end]
  $s destroy
  set res
} {151.71 1265.8 2097.1 2948.0 651.9 693.92 580.95 513.44}


# cleanup
::tcltest::cleanupTests
return