Title: Why would wave read be normalized ? · Issue #268 · python-acoustics/python-acoustics · GitHub
Open Graph Title: Why would wave read be normalized ? · Issue #268 · python-acoustics/python-acoustics
X Title: Why would wave read be normalized ? · Issue #268 · python-acoustics/python-acoustics
Description: Hi there ! I've spend a some time figuring it out but wav file read is normalized... To me (as an acoustic engineer) it makes absolutely no sense :) Especially since there are some calibrate_to and calibrate_with functions. Am I missing ...
Open Graph Description: Hi there ! I've spend a some time figuring it out but wav file read is normalized... To me (as an acoustic engineer) it makes absolutely no sense :) Especially since there are some calibrate_to and...
X Description: Hi there ! I've spend a some time figuring it out but wav file read is normalized... To me (as an acoustic engineer) it makes absolutely no sense :) Especially since there are some calibrate_to...
Opengraph URL: https://github.com/python-acoustics/python-acoustics/issues/268
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Why would wave read be normalized ?","articleBody":"Hi there !\r\n\r\nI've spend a some time figuring it out but wav file read is normalized...\r\nTo me (as an acoustic engineer) it makes absolutely no sense :)\r\nEspecially since there are some `calibrate_to` and `calibrate_with` functions.\r\nAm I missing something ? Why would you normalize on import ?\r\n\r\nI ended up with the following code to read from the wave file : \r\n```python\r\nimport acoustics\r\nimport wave\r\nfrom scipy.io import wavfile\r\nfile_path = \"whatever.wav\"\r\nwith wave.open(file_path, 'rb') as wav:\r\n sampwidth = wav.getsampwidth()\r\nfs, data = wavfile.read(file_path) \r\ndata = data / 2**(8*sampwidth-1)\r\nsignal= acoustics.Signal(data, fs=fs)\r\n```\r\n\r\nThis works with `S16_LE`, `S32_LE`, `S24_3LE ` formats (using the ALSA labelling) but would fail with `S24_LE` or `FLOAT_LE ` .\r\nIt would be nice to have any wav red as a float array in the end.\r\n\r\nI would be happy to contribute, I just want to make sure I didn't misunderstand an intentional design choice.","author":{"url":"https://github.com/Nitnelav","@type":"Person","name":"Nitnelav"},"datePublished":"2024-02-07T07:46:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/268/python-acoustics/issues/268"}
| 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:cde0ff60-2102-edbf-37c6-ae4542040edf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8080:39D8D:6F267A:96B575:698F6978 |
| html-safe-nonce | bedbd8536d67bdea7bf77a45a0718783d62abaa3210d156ec7510a722e5de487 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDgwOjM5RDhEOjZGMjY3QTo5NkI1NzU6Njk4RjY5NzgiLCJ2aXNpdG9yX2lkIjoiNzgxMDUxMzIzMzQ1NDc4NjkzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 98feb5b52129d5d6fc5a923568d8dac367b0d4407ac3a60d1c3521566c7b45e6 |
| hovercard-subject-tag | issue:2122394205 |
| 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-acoustics/python-acoustics/268/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7a3832d9d39e9b8dac24c0e0421ba2a3b644883d64324ac7b8f344f3ea2dba8b/python-acoustics/python-acoustics/issues/268 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7a3832d9d39e9b8dac24c0e0421ba2a3b644883d64324ac7b8f344f3ea2dba8b/python-acoustics/python-acoustics/issues/268 |
| og:image:alt | Hi there ! I've spend a some time figuring it out but wav file read is normalized... To me (as an acoustic engineer) it makes absolutely no sense :) Especially since there are some calibrate_to and... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Nitnelav |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7ab1c9acb90dba91d5e994ebfb6bfb1130e0e0e6aca329cdbbd934d636e22ab6 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-acoustics/python-acoustics git https://github.com/python-acoustics/python-acoustics.git |
| octolytics-dimension-user_id | 3644840 |
| octolytics-dimension-user_login | python-acoustics |
| octolytics-dimension-repository_id | 14710112 |
| octolytics-dimension-repository_nwo | python-acoustics/python-acoustics |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14710112 |
| octolytics-dimension-repository_network_root_nwo | python-acoustics/python-acoustics |
| 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 | 1d6695367a1b2f05addc4030b791720f01693df4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width