-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
By default, return float64, but provide options for reading different formats. #17
Comments
Interesting point. Come to think of it, I don't see many reasons why we shouldn't just switch everything over to The only argument against that would be that there is no microphone able to record more than 24 bits, let alone ears cabable of hearing more, which makes anything more than 32 bits kind of a waste. I can see 64 bit being useful for non-audio data though. One could also make an argument that if the source data is, say, |
The more I think about it, the more I'm convinced that It's true that a sound card won't provide more than 24 meaningful bits, but we can't foresee what the user will be doing with the data. There are many DSP algorithms which only make sense when using double precision. And if a user wishes to save memory, they are free to explicitly choose I agree that it's not a good idea to return integers by default. In addition to your reasons it's also hard to keep track of the maximum range of the different integer formats. I don't like the idea of
Also, I'm not sure if there is a unique mapping from each subtype to one of the NumPy types. BTW, I implemented the change from the |
I agree. Let's go with Btw, I didn't know you could use For some reason, I have a bad feeling about going all |
I tried to implement the select-dtype-based-on-subtype feature and found out that it's not really that great after all.
Long story short, I suggest to just make |
Agreed. |
What, then, is the proposed way to discover and load the native format? I am moving audio from a file system to a database and would like to store them in their native resolution. |
Essentially, check the subtype manually, then |
Is there a function available for this manual check? Or do I need to inspect the header directly? Or use python's built-in |
|
I think it's a good idea to return
np.float32
by default (although I'm not 100% sure because the default type in NumPy isnp.float64
).If the file has 64bit values, however, they shouldn't be truncated by default.
So probably the default argument to
read()
should beformat=None
which should be changed appropriately within the function.BTW,
format
may not be the best name choice for this parameter, maybedtype
would be rather what people would expect?The text was updated successfully, but these errors were encountered: