Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
Open
Description
Feature or enhancement
Proposal:
TheWave_write
class does not allow to "reset" the same value. This makes some implementations quite complicated, as if you want to continuously append data to the wav file, you need to differentiate between first and the other writes.
Libraries, that use this class (for examplepiper-tts) are sometimes making it hard to do this right. Which is probably a bug in those libraries, but i think python should make it easier for them to not make this mistake.
importwavewithwave.open(open('out.wav','wb'),'w')asw:w.setframerate(44100)w.setnchannels(1)w.setsampwidth(1)w.writeframes(b'0'*44100)w.setframerate(44100)# should not failw.setnchannels(1)# should not failw.setsampwidth(1)# should not failw.setframerate(22050)# should still failw.setnchannels(2)# should still failw.setsampwidth(2)# should still fail
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response