pytorchupandrunning
pytorchupandrunning copied to clipboard
update variable sample_rate to sr
On line 300 the variable sample_rate should be changed to sr. In the function librosa.load, sr=None allows us to use the native sample rate of the audio file being examined, but currently we are ignoring that sample rate due to a mismatch in variable names. Prior to this function sr is defined on line 286 so every file is using that sample rate. Assuming all files are using the same sample rate this is ok, but probably not what you were intending to do as unused variables are often saved to "_" to show they are unused.
Making this change would allow the following line's function librosa.feature.melspectrogram to properly use the native sample rate which was determined when sr=None in the pervious function.
Nick - can I get you to make these PRs against https://github.com/falloutdurham/beginners-pytorch-deep-learning/ instead? I'm likely to archive this repo at the weekend to avoid confusion. Thanks!
You got it. I really like the book and I'm happy to help out!