Last active
February 5, 2023 10:37
-
-
Save diewland/bff7e7a07035747df0d3a8b6c464e75c to your computer and use it in GitHub Desktop.
convert wav to flac from python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os.path import splitext | |
from pydub import AudioSegment | |
def wav2flac(wav_path): | |
flac_path = "%s.flac" % splitext(wav_path)[0] | |
song = AudioSegment.from_wav(wav_path) | |
song.export(flac_path, format = "flac") | |
if __name__ == "__main__": | |
import sys | |
wav2flac(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment