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
| # frozen_string_literal: true | |
| require 'csv' | |
| ##### CSV To Audio Speech Converter #### | |
| #== README | |
| # This script takes a CSV file and converts its contents to audio files by | |
| # using the OSX builtin speech synthesizer. The CSV input file must not contain | |
| # a header line and all words or lines must be stored in the first column. If |
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
| 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 |
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
| { | |
| events: { | |
| {"type": "transaction", "some": "attributes", "relevant": true}, | |
| {"type": "voucher", "some": "attributes", "relevant": true}, | |
| } | |
| } |
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
| vegetable_descriptions = Atelier::VegetableDescription.last(20) | |
| vegetable_descriptions.each do |vd| | |
| puts vd.description.inspect | |
| puts "enter inproved version, blank means no change" | |
| input_description = gets | |
| if input_description != "\n" | |
| input_description.chomp! | |
| vd.description = input_description | |
| if vd.save | |
| puts "new description saved" |