classification
Title: Wave documentation doesn't mention signed/unsigned requirements
Type: enhancement Stage:
Components: Documentation Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, mattgwwalker, terry.reedy
Priority: normal Keywords:

Created on 2020-12-14 07:03 by mattgwwalker, last changed 2020-12-18 23:45 by terry.reedy.

Messages (2)
msg382957 - (view) Author: Matthew Walker (mattgwwalker) Date: 2020-12-14 07:03
It would be very useful if the documentation for Python's Wave module mentioned that 8-bit samples must be unsigned while 16-bit samples must be signed.

See the Wikipedia article on the WAV format: "There are some inconsistencies in the WAV format: for example, 8-bit data is unsigned while 16-bit data is signed" https://en.wikipedia.org/wiki/WAV

Although I haven't contributed previously, I would be pleased to make such a contribution if it would be appreciated.
msg383332 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-12-18 23:45
I not sure about 'very useful'.  One has to know a lot more than the sample width in bytes, which can be 1 to 4 (according to the code), not just 1 to 2 (as implied by https://en.wikipedia.org/wiki/WAV), to effectively use the module.  Such things as the endianess of multibyte samples and what is 'linear pulse code modulation'.  The docs assume that one know all this from another source.
History
Date User Action Args
2020-12-18 23:45:56terry.reedysetnosy: + terry.reedy
messages: + msg383332
2020-12-14 07:03:20mattgwwalkercreate