Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wave_write throws an error if a setter to an written header information is set to the same value #132445

Open
Labels
stdlibPython modules in the Lib dirtype-featureA feature request or enhancement
@ygerlach

Description

@ygerlach

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

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp