Open magicse opened 2 years ago
After replacing libsndfile64bit.dll in folder C:\Python38\Lib\site-packages_soundfile_data\ with dll file from package libsndfile-1.1.0-win64.zip, mp3 load work well. But I gen another issue. This code give me error
torchaudio.save(fname, np.asfortranarray(wavs[i].squeeze().numpy()), sample_rate)
Error
Traceback (most recent call last):
File "Z:\AI_SDK\CPP_GFPGAN\Vocal_Spletter\spleeter-pytorch-mnn-main\spleeter-pytorch-mnn-main\test_estimator.py", line 48, in <module>
torchaudio.save(fname, np.asfortranarray(wavs[i].squeeze().numpy()), sample_rate, channels_first=True) # save tensor to file, as usual
File "C:\Python38\lib\site-packages\torchaudio\backend\soundfile_backend.py", line 425, in save
subtype = _get_subtype(src.dtype, ext, encoding, bits_per_sample)
File "C:\Python38\lib\site-packages\torchaudio\backend\soundfile_backend.py", line 282, in _get_subtype
return _get_subtype_for_wav(dtype, encoding, bits_per_sample)
File "C:\Python38\lib\site-packages\torchaudio\backend\soundfile_backend.py", line 234, in _get_subtype_for_wav
raise ValueError(f"Unsupported dtype for wav: {dtype}")
ValueError: Unsupported dtype for wav: float32
If I saving wave file like this. It's work well without any issues
soundfile.write(fname, np.asfortranarray(wavs[i].squeeze().numpy()).transpose(), sample_rate)
pull request for mp3 support https://github.com/pytorch/audio/pull/2712
🐛 Describe the bug
My code
Get error raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace')) RuntimeError: Error opening './123.mp3': File contains data in an unknown format.
wavs files loading without any problem. Also info about sound file
{'AIFF': 'AIFF (Apple/SGI)', 'AU': 'AU (Sun/NeXT)', 'AVR': 'AVR (Audio Visual Research)', 'CAF': 'CAF (Apple Core Audio File)', 'FLAC': 'FLAC (Free Lossless Audio Codec)', 'HTK': 'HTK (HMM Tool Kit)', 'SVX': 'IFF (Amiga IFF/SVX8/SV16)', 'MAT4': 'MAT4 (GNU Octave 2.0 / Matlab 4.2)', 'MAT5': 'MAT5 (GNU Octave 2.1 / Matlab 5.0)', 'MPC2K': 'MPC (Akai MPC 2k)', 'OGG': 'OGG (OGG Container format)', 'PAF': 'PAF (Ensoniq PARIS)', 'PVF': 'PVF (Portable Voice Format)', 'RAW': 'RAW (header-less)', 'RF64': 'RF64 (RIFF 64)', 'SD2': 'SD2 (Sound Designer II)', 'SDS': 'SDS (Midi Sample Dump Standard)', 'IRCAM': 'SF (Berkeley/IRCAM/CARL)', 'VOC': 'VOC (Creative Labs)', 'W64': 'W64 (SoundFoundry WAVE 64)', 'WAV': 'WAV (Microsoft)', 'NIST': 'WAV (NIST Sphere)', 'WAVEX': 'WAVEX (Microsoft)', 'WVE': 'WVE (Psion Series 3)', 'XI': 'XI (FastTracker 2)'}
ffmpeg version
Versions
Is CUDA available: False CUDA runtime version: No CUDA GPU models and configuration: No CUD Nvidia driver version: No CUDA cuDNN version: No CUDA HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True
Versions of relevant libraries: [pip3] numpy==1.23.3 [pip3] pytorch2caffe==0.1.0 [pip3] torch==1.12.1 [pip3] torchaudio==0.12.1 [pip3] torchvision==0.13.1 [pip3] torchviz==0.0.2 [conda] Could not collect