Issue 19641: Add audioop.byteswap() - Python tracker (original ) (raw ) Issue19641
Created on 2013-11-18 10:25 by serhiy.storchaka , last changed 2022-04-11 14:57 by admin . This issue is now closed .
Messages (5)
msg203273 - (view)
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2013-11-18 10:25
The audio modules often need convert between little endian and big endian data. The array module can be used to byteswap 16- and 32-bit samples, but it can't help with 24-bit samples. Python implemented function for swapping bytes is not very efficient. In any case the use of array is not so simple (see , ). The proposed patch adds efficient byteswap() function in the audioop module. byteswap(fragment, width) byteswaps every "width"-byte sample in the fragment and returns modified data.
msg203284 - (view)
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2013-11-18 11:58
Updated patch addresses some Victor's comments. Added optimization for trivial case byteswap(bytes, 1).
msg203601 - (view)
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2013-11-21 10:14
The patch is synchronized with tip (after committing ). It enables temporary disabled in tests.
msg204100 - (view)
Author: Roundup Robot (python-dev)
Date: 2013-11-23 20:27
New changeset fbebc90abcd1 by Serhiy Storchaka in branch 'default': Issue #19641 : Added the audioop.byteswap() function to convert big-endian http://hg.python.org/cpython/rev/fbebc90abcd1
msg204101 - (view)
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2013-11-23 20:29
I have committed simplified patch, without optimization for 1-byte samples.
History
Date
User
Action
Args
2022-04-11 14:57:53
admin
set
github: 63840
2013-11-23 20:29:14
serhiy.storchaka
set
status: open -> closedmessages: + assignee: serhiy.storchaka resolution: fixedstage: patch review -> resolved
2013-11-23 20:27:40
python-dev
set
nosy: + python-dev messages: +
2013-11-21 10:14:30
serhiy.storchaka
set
files: + audioop_byteswap_3.patch messages: +
2013-11-18 11:58:24
serhiy.storchaka
set
files: + audioop_byteswap_2.patch messages: +
2013-11-18 10:25:07
serhiy.storchaka
create