Skip to content

make lin2lin endian-aware for big-endian systems#44

Open
EdwardBetts wants to merge 1 commit intoOHF-Voice:mainfrom
EdwardBetts:patch-1
Open

make lin2lin endian-aware for big-endian systems#44
EdwardBetts wants to merge 1 commit intoOHF-Voice:mainfrom
EdwardBetts:patch-1

Conversation

@EdwardBetts
Copy link

The _get_sample32 and _set_sample32 functions in pyaudioop.py were using hardcoded little-endian byte manipulation, causing test failures on big-endian architectures like s390x.

Replace manual byte operations with struct.pack_into/unpack_from using native byte order format characters ('b', 'h', 'i').

Fixes test failure: test_pyaudioop.py::test_lin2lin on s390x

The _get_sample32 and _set_sample32 functions in pyaudioop.py were using hardcoded little-endian byte manipulation, causing test failures on big-endian architectures like s390x.

Replace manual byte operations with struct.pack_into/unpack_from using native byte order format characters ('b', 'h', 'i').

Fixes test failure: test_pyaudioop.py::test_lin2lin on s390x
@synesthesiam
Copy link
Contributor

We may want to have an endian flag instead, since the audio in WAVE files is specifically little-endian.

@EdwardBetts
Copy link
Author

We may want to have an endian flag instead, since the audio in WAVE files is specifically little-endian.

I guess you are saying the code was correct and the tests are wrong. The tests need to assume little-endian order instead of native order for the current CPU architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants