AudioSegment JSONDecodeError
selintunr opened this issue · 1 comments
selintunr commented
I'm trying to load a mp3 file with AudioSegment as follows:
temp_audio_path = "/Users/selin/Desktop/deneme.mp3"
audio = AudioSegment.from_mp3(temp_audio_path)
I get the error :
File "/Users/selin/Desktop/diktatorial-backend/env/lib/python3.9/site-packages/pydub/audio_segment.py", line 796, in from_mp3
return cls.from_file(file, 'mp3', parameters=parameters)
File "/Users/selin/Desktop/diktatorial-backend/env/lib/python3.9/site-packages/pydub/audio_segment.py", line 728, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
File "/Users/selin/Desktop/diktatorial-backend/env/lib/python3.9/site-packages/pydub/utils.py", line 279, in mediainfo_json
info = json.loads(output)
File "/Users/selin/opt/anaconda3/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/Users/selin/opt/anaconda3/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/selin/opt/anaconda3/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
My System configuration
- Python version: 3.9.13
- Pydub version: 0.25.1
- ffmpeg version : 6.0
Here is my audio file:
deneme.mp3.zip
selintunr commented
This worked for me:
temp_audio_path = "/Users/selin/Desktop/deneme.mp3"
#audio = AudioSegment.from_mp3(temp_audio_path) instead of this
audio = AudioSegment.from_file(temp_audio_path, "mp3")