Sha256: 02cf621859d145d24cb172b03de90d741122a0c2530c9d3414126a57551b6a5a

Contents?: true

Size: 755 Bytes

Versions: 30

Compression:

Stored size: 755 Bytes

Contents

from test_support import TestFailed
import os, tempfile
import wave

def check(t, msg=None):
    if not t:
        raise TestFailed, msg

nchannels = 2
sampwidth = 2
framerate = 8000
nframes = 100

testfile = tempfile.mktemp()

f = wave.open(testfile, 'wb')
f.setnchannels(nchannels)
f.setsampwidth(sampwidth)
f.setframerate(framerate)
f.setnframes(nframes)
output = '\0' * nframes * nchannels * sampwidth
f.writeframes(output)
f.close()

f = wave.open(testfile, 'rb')
check(nchannels == f.getnchannels(), "nchannels")
check(sampwidth == f.getsampwidth(), "sampwidth")
check(framerate == f.getframerate(), "framerate")
check(nframes == f.getnframes(), "nframes")
input = f.readframes(nframes)
check(input == output, "data")
f.close()

os.remove(testfile)

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rubyfox-server-2.19.2.0 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.17.3.2 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.17.3.1 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.17.3.0 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.16.3.2 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.16.3.1 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.16.0.4 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.16.0.3 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.16.0.2 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.16.0.1 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.16.0.0 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.13.7.3 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.13.6.2 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.13.6.1 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.13.5.1 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.13.4.1 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.13.3.1 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.12.5.1 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.12.5.0 lib/rubyfox/server/data/lib/Lib/test/test_wave.py
rubyfox-server-2.12.4.0 lib/rubyfox/server/data/lib/Lib/test/test_wave.py