Title: Wave_write throws an error if a setter to an written header information is set to the same value · Issue #132445 · python/cpython · GitHub
Open Graph Title: Wave_write throws an error if a setter to an written header information is set to the same value · Issue #132445 · python/cpython
X Title: Wave_write throws an error if a setter to an written header information is set to the same value · Issue #132445 · python/cpython
Description: Feature or enhancement Proposal: The Wave_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 betw...
Open Graph Description: Feature or enhancement Proposal: The Wave_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 ...
X Description: Feature or enhancement Proposal: The Wave_write class does not allow to "reset" the same value. This makes some implementations quite complicated, as if you want to continuously append da...
Opengraph URL: https://github.com/python/cpython/issues/132445
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Wave_write throws an error if a setter to an written header information is set to the same value","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nThe `Wave_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.\nLibraries, that use this class (for example [piper-tts](https://github.com/rhasspy/piper/blob/master/src/python_run/piper/voice.py#L100-L102)) 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.\n\n```python\nimport wave\n\nwith wave.open(open('out.wav', 'wb'), 'w') as w:\n\tw.setframerate(44100)\n\tw.setnchannels(1)\n\tw.setsampwidth(1)\n\tw.writeframes(b'0' * 44100)\n\n\tw.setframerate(44100) # should not fail\n\tw.setnchannels(1) # should not fail\n\tw.setsampwidth(1) # should not fail\n\n\tw.setframerate(22050) # should still fail\n\tw.setnchannels(2) # should still fail\n\tw.setsampwidth(2) # should still fail\n```\n\n\n### Has this already been discussed elsewhere?\n\nNo response given\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-132448\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/ygerlach","@type":"Person","name":"ygerlach"},"datePublished":"2025-04-12T16:33:08Z","url":"https://github.com/python/cpython/issues/132445"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0107b665-8745-28c2-07f2-c42679edb6ca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD7C:1AFA9B:40DE97:573EDE:6AECCBFE |
| html-safe-nonce | acb3f8e5d2c709e4bdd04e7961e0c76e38ec1650109c2fe142936fa3bbd6fd0b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDdDOjFBRkE5Qjo0MERFOTc6NTczRURFOjZBRUNDQkZFIiwidmlzaXRvcl9pZCI6IjE1MzgzNzAwMzkyNTU0NTI2NzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f200552d5298ebe8e6e5f82969c0f29e6cebeb63827badb528474dcec163d099 |
| hovercard-subject-tag | issue:2990560107 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/132445/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1fd8d8b31a3d3e92c8a7029769d4e1cc8b2e4f8124d6893b4d6f8d24c27934c2/python/cpython/issues/132445 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1fd8d8b31a3d3e92c8a7029769d4e1cc8b2e4f8124d6893b4d6f8d24c27934c2/python/cpython/issues/132445 |
| og:image:alt | Feature or enhancement Proposal: The Wave_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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ygerlach |
| hostname | github.com |
| expected-hostname | github.com |
| None | dc0b519c5798dc1150b88dc4c06a8b9634d0069218dc04e469970e76aad74016 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | db139f0bf57b59bf9a8c4abb0849924d6c6ca559 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width