This repository was archived by the owner on Feb 7, 2024. It is now read-only.
[SIGNAL] Changed audio loading backend to soundfile#221
Closed
adrian-stepien wants to merge 2 commits intopython-acoustics:masterfrom
Closed
[SIGNAL] Changed audio loading backend to soundfile#221adrian-stepien wants to merge 2 commits intopython-acoustics:masterfrom
adrian-stepien wants to merge 2 commits intopython-acoustics:masterfrom
Conversation
FRidh
suggested changes
Dec 8, 2018
|
|
||
|
|
||
| def to_wav(self, filename, depth=16): | ||
| def to_wav(self, filename, normalize=False, depth=16, format="WAV"): |
Member
There was a problem hiding this comment.
remove normalization. It's possible to chain commands so there is no need to add this here
|
|
||
| @classmethod | ||
| def from_wav(cls, filename): | ||
| def from_wav(cls, filename, normalize=False): |
Member
There was a problem hiding this comment.
Separate commit. Don't change the default behavior. I'm not yet sure whether I agree on offering this, because typically the level of a WAV file is irrelevant; one always wants to scale with a reference.
Contributor
Author
There was a problem hiding this comment.
In certain applications, knowing the level simplifies a lot. Currently that information is lost if the file is being saved. An example of that is given in #222.
As you said - normalisation is optional, so it can be done afterwards.
Fixed the `normalize` function to take into account the maximum of absolute values, not only the positive ones.
Thanks to pysoundfile it's possible to laod WAV and FLAC files with integer samples. (Floating point is there out of the box, but requires a bit of API refactoring). Things removed: - When saving, samples are no-longer normalized - Normalization is optional during loading - by default it's off
88908a6 to
33d4f83
Compare
dad3bc2 to
1ab2ec3
Compare
This was referenced Oct 28, 2019
Closed
Member
|
Rebased in #238. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using pysoundfile which allows for: