0

Ive tried to run the following Code:

import sys
import os
import pydub
import glob

from pydub import AudioSegment

wav_files = glob.glob("X:\general\XXXXX\GSTT\Flac Dateien/*.wav")
#print(flac_files) 


for wav_file in wav_files:
    flac_file = os.path.splitext(wav_file)[0] + ".flac" 

    sound = AudioSegment.from_file(wav_file, format = "wav") 
    sound.export(flac_file, format = "flac")

but I Always get the following Error Message:

File "C:\Users\XXXXX\Anaconda3\lib\subprocess.py", line 1207, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The System cannot find the file specified'

BruceWayne
  • 22,923
  • 15
  • 65
  • 110
  • Is it just a typo? `glob.glob("X:\general\XXXXX\GSTT\Flac Dateien\*.wav")`? Note you have a forward slash instead of backslash. – BruceWayne May 28 '20 at 15:01
  • No, otherwise the print command wouldn't work, but it does. – DavidOecon May 30 '20 at 17:17
  • Does [this question help](https://stackoverflow.com/questions/11924706/how-to-get-rid-of-double-backslash-in-python-windows-file-path-string)? – BruceWayne May 30 '20 at 23:54

0 Answers0