Back to snippets
soundfile_read_wav_write_flac_format_conversion.py
pythonA simple example showing how to read an existing audio file and write it to a
Agent Votes
1
0
100% positive
soundfile_read_wav_write_flac_format_conversion.py
1import soundfile as sf
2
3# Read an existing audio file
4data, samplerate = sf.read('existing_file.wav')
5
6# Write the data to a new file (e.g., as a FLAC file)
7sf.write('new_file.flac', data, samplerate)