-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Description
Feature or enhancement
Make the named tuple _wave_parameters public. This nameed tuple defines the inputs to Wave_write.setparams which is a public method that users would want to call. To best create an input to setparams one would ideally first make a _wave_parameters named tuple.
This is especially true in a typed environment (see python/typeshed#8322) but I feel it would be useful for all users of the wave module.
Pitch
Currently if one wants to call setparams in a typed setting, the only option is to use the private type:
import wave
with wave.open("test.wav", "wb") as wav_file:
params = wave._wave_params(
nchannels=1, sampwidth=2, framerate=16_000, nframes=0, comptype="NONE", compname="NONE",
)
wav_file.setparams(params)There is no way to call setparams in a typed environment without using the wave._wave_params. If instead it was made public, all users could use the readable version of the parameters above, rather than pass in a tuple without kowing which numbers meant waht.
Previous discussion