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

fix(data_utils): allow float32 audio to be processed properly #115

Merged
merged 1 commit into from
Mar 26, 2023

Conversation

BlueAmulet
Copy link
Collaborator

@BlueAmulet BlueAmulet commented Mar 25, 2023

In an attempt to cut down on noise introduced by int16 wav quantization, I wanted to try using float32 wav files instead.

I found that python's wave library does not understand float32, so I removed the wave library based duration code for librosa's get_duration function instead.

I was also getting a WavFileWarning: Chunk (non-data) not understood, skipping it. message from scipy.io.wavfile.read. I noticed that the load_wav_to_torch() function + the normalization and unsqueeze, results in the exact same format as a simple torchaudio.load(), so this code has been simplified as well.

@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2023

Codecov Report

Merging #115 (e597a9a) into main (baf58d2) will decrease coverage by 0.14%.
The diff coverage is 66.66%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #115      +/-   ##
==========================================
- Coverage   16.80%   16.67%   -0.14%     
==========================================
  Files          28       28              
  Lines        3391     3382       -9     
  Branches      393      391       -2     
==========================================
- Hits          570      564       -6     
+ Misses       2810     2807       -3     
  Partials       11       11              
Impacted Files Coverage Δ
src/so_vits_svc_fork/preprocess_flist_config.py 89.39% <50.00%> (-1.02%) ⬇️
src/so_vits_svc_fork/data_utils.py 17.97% <66.66%> (+1.49%) ⬆️
src/so_vits_svc_fork/__init__.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@34j 34j changed the title fix: allow float32 audio to be processed properly fix(data_utils): allow float32 audio to be processed properly Mar 26, 2023
@34j 34j merged commit 13943b6 into voicepaw:main Mar 26, 2023
@34j
Copy link
Collaborator

34j commented Mar 26, 2023

@allcontributors add BlueAmulet code

@allcontributors
Copy link
Contributor

@34j

I've put up a pull request to add @BlueAmulet! 🎉

34j added a commit that referenced this pull request Mar 26, 2023
@BlueAmulet BlueAmulet deleted the fix/audio_loading branch April 13, 2023 21:38
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.

3 participants