Skip to content
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

Fixed README demo to read wav properly #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

awildfivreld
Copy link

@awildfivreld awildfivreld commented Jan 19, 2020

The current readme leaves out a crucial step (dividing wav data by 32768) in order for the algorithm to work correctly. This PR fixes that for future reference. I have tested with the fish example from Google Colab. It does not work as intended without this fix.

Flatten is also added for stereo audio streams.

@timsainb
Copy link
Owner

Could you send me a notebook of the example not working in colab without flattening? / with flattening? Maybe it would be a good idea to add a link to that example in the readme as well.
Thanks!

@awildfivreld
Copy link
Author

https://colab.research.google.com/drive/1VcQvams218kGGQjFzlP1uK7F3UsDBERl
The audio itself is just noise, but it conveys the point.

@timsainb
Copy link
Owner

Hi @awildfivreld thanks for posting. np.flatten() is taking the 2d audio (2, 200542) dimensional audio and making it 1d (401084,). If the audio is 2D and we want to convert it to mono, we would want to do something like this:
https://librosa.github.io/librosa/generated/librosa.core.to_mono.html
If we wanted to keep dual streams, we cold independantly apply noisereduce to each channel. I don't think flattening is the best way to handle these errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants