Skip to content

Fixed README demo to read wav properly#31

Open
awildfivreld wants to merge 2 commits into
timsainb:masterfrom
awildfivreld:master
Open

Fixed README demo to read wav properly#31
awildfivreld wants to merge 2 commits into
timsainb:masterfrom
awildfivreld:master

Conversation

@awildfivreld

@awildfivreld awildfivreld commented Jan 19, 2020

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Author

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

@timsainb

Copy link
Copy Markdown
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