1 from test_support
import TestFailed
5 def check(t
, msg
=None):
14 testfile
= tempfile
.mktemp()
16 f
= wave
.open(testfile
, 'wb')
17 f
.setnchannels(nchannels
)
18 f
.setsampwidth(sampwidth
)
19 f
.setframerate(framerate
)
21 output
= '\0' * nframes
* nchannels
* sampwidth
25 f
= wave
.open(testfile
, 'rb')
26 check(nchannels
== f
.getnchannels(), "nchannels")
27 check(sampwidth
== f
.getsampwidth(), "sampwidth")
28 check(framerate
== f
.getframerate(), "framerate")
29 check(nframes
== f
.getnframes(), "nframes")
30 input = f
.readframes(nframes
)
31 check(input == output
, "data")