Skip to content

Instantly share code, notes, and snippets.

@knorrli
Created December 22, 2021 12:32
Show Gist options
  • Save knorrli/a3bc0e261a056b842bfde2e0e5a27314 to your computer and use it in GitHub Desktop.
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
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