Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: io: add 24-bit support to wavfile #6852

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added scipy/io/tests/data/test-44100Hz-24bit.wav
Binary file not shown.
13 changes: 13 additions & 0 deletions scipy/io/tests/test_wavfile.py
Expand Up @@ -78,6 +78,19 @@ def test_read_5():
del data


def test_read_24bit():
for mmap in [False, True]:
rate, data, meta = wavfile.read(datafile('test-44100Hz-24bit.wav'),
mmap=mmap, return_metadata=True)
assert_equal(rate, 44100)
assert_(np.issubdtype(data.dtype, np.int32))
assert_equal(data.shape, (11025, 2))
assert_equal(meta['pitch'], 440.0)
assert_equal(meta['bit_depth'], 24)
assert_equal(meta['cues'], [(4410, None), (8820, None)])
del data


def test_read_fail():
for mmap in [False, True]:
fp = open(datafile('example_1.nc'))
Expand Down