I'm getting:
Exception has occurred: TypeError
a bytes-like object is required, not 'str'
When I run the following code:
from pydub import AudioSegment
from pydub.utils import which
AudioSegment.converter = which('ffmpeg')
AudioSegment.ffmpeg = r"C:\PATH_Programs\bin\ffmpeg.exe"
audio = AudioSegment(r'C:\Users\jack_l\Documents\Cm - 120 BPM.wav') #ERROR HERE
What I know:
- I have ffmpeg on my path (also set in code)
- I'm running python 3.9.13 and pydub version 0.25.1
- Error happens with or without the
AudioSegment.converter
andAudioSegment.ffmpeg
lines – I just have them there to show I've tried that.
What am I doing wrong? Thanks