Created
December 22, 2021 12:32
-
-
Save knorrli/a3bc0e261a056b842bfde2e0e5a27314 to your computer and use it in GitHub Desktop.
Small script to convert words stored in a CSV to sound snippets in .wav format
This file contains 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
require 'csv' | |
out_dir = "./out" | |
def convert_csv_to_wav_snippets | |
read_csv.each do |row| | |
word = row[0] | |
%x[say -o #{out_dir}/#{word}.wav --data-format=LEF32@32000 \"#{word}\"] | |
end | |
end | |
convert_csv_to_wav_snippets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment