Python Leiden (NL) meetup: newwave, python package setup and cpython contribution - Michiel Beijen

Tags: python, pun

(One of my summaries of the Leiden (NL) Python meetup).

Wave audio is more or less the original representation of digital audio. .wav format (there are competing formats like .au or .aiff). Typically it is “PCM-encoded”, just as what comes out of the CD.

The .wav format was introduced by microsoft in windows 3.1 in 1992. But… it is still relevant for audio production or podcasts. And: for lab equipment. The company Michiel works for (https://samotics.com/, sponsor of the meetup’s pizza, thanks!) records the sound of big motors and other big equipment for analysis purposes. They use .wav for this.

Around 1992, Python also started to exist. Version 1.0 (1994) included the “wave” module in its standard library. But: it is only intended for regular .wav usage, so two stereo channels and max 44.1 kHz frequency. He needed three channels (for sound recordings for the three phases of the electrical motor) and he needed higher resolution.

He showed that you could actually put three channels into a .wav with Python. Audacity loaded it just fine, but the “flac” encoder refused it, with an error about a missing WAVE_FORMAT_EXTENSIBLE setting. He started investigating the python bugtracker and discovered someone had already provided a fix for reading wav files in that extended format.

So he dug further. And discovered some bugs himself and reported them. And found undocumented methods and reported them. So after reports, you should try fixing them with a pull request. He discovered a half-finished PR and worked on basis of that. Lots of discussion in the ticket, but in the end it got merged. Another bugfix also got merged. Hurray!

But… those fixes will end up in Python 3.15, October 2026. And his company is just moving from 3.10 to 3.11… So he made a library out of it at https://codeberg.org/michielb/newwave . (And he put in some good words for https://codeberg.org , as that’s a nice github alternative: operated by volunteers under a German Foundation instead of we-have-put-all-our-open-source-eggs-in-one-basket’s Github, being owned by Microsoft/USA).