├── README.md ├── arguing-robots ├── arguing-robots.cr ├── examples ├── montreal-in-the-winter.txt └── netflix-n-tchill.txt ├── how-to.gif └── lain_navi.jpg /README.md: -------------------------------------------------------------------------------- 1 | # 🤖 Arguing robots 🤖 2 | 3 | Arguing robots is a simple CLI utility for macOS that allow the wonderfully expressive [PlainTalk](https://www.wikiwand.com/en/PlainTalk) voices of macOS (including beloved *whisper* voice of [Lain](https://www.wikiwand.com/en/Serial_Experiments_Lain)'s Navi) to come to life in your terminal. It also was my Hello World project for learning [Crystal](https://crystal-lang.org/). 4 | 5 | ![How to use arguing robots](how-to.gif) 6 | 7 | ## Available voices 8 | 9 | Type `say -v '?'` in your terminal to get a list of all available voices 10 | 11 | ## Usage 12 | 13 | * Download the [CLI](https://github.com/christophemarois/arguing-robots/raw/master/arguing-robots) 14 | * Make a `.txt` containing dialogue lines in the following format: `[voice]: [text]` , like this one: 15 | 16 | ``` 17 | Alex: Hi, how are you doing? 18 | Karen: I'm good! How about you? 19 | Alex: Good. I've been thinking about this city today. 20 | Victoria: Really? How so? 21 | Karen: Oh, Victoria, you're here! 22 | Victoria: Yes, I arrived two minutes ago. 23 | Karen: So what about this city, Alex? 24 | Alex: It's just... 25 | Alex: How Montreal in the winter inspires people to do art. 26 | ``` 27 | 28 | * Pass the txt as an argument to the CLI (you can also open a terminal, drag the CLI on it, then drag the txt, then press enter): 29 | 30 | ``` 31 | ./arguing-robots examples/montreal-in-the-winter.txt 32 | ``` 33 | 34 | * Hear and watch robots argue 35 | 36 | --- 37 | 38 | **Whisper:** Who is Lain? 39 | 40 | ![Lain's Navi](lain_navi.jpg) 41 | -------------------------------------------------------------------------------- /arguing-robots: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christophemarois/arguing-robots/7bd30358376aa720498d98e27f9d33b37c65d6c2/arguing-robots -------------------------------------------------------------------------------- /arguing-robots.cr: -------------------------------------------------------------------------------- 1 | if ARGV.size === 0 || !(ARGV[0].downcase =~ /\.txt$/) 2 | raise "Error: You must provide a .txt as the first argument" 3 | end 4 | 5 | begin 6 | content = File.read(ARGV[0]) 7 | rescue 8 | raise "Could not open file #{ARGV[0]}" 9 | end 10 | 11 | content.split(/\n/).compact.each.with_index do |line, i| 12 | line = line.delete "\"" 13 | 14 | parts = line.split(':') 15 | 16 | voice = parts[0].strip 17 | text = parts[1..-1].join(':').strip 18 | 19 | next if voice.empty? || text.nil? || text.empty? 20 | 21 | puts "#{voice}: \"#{text}\"" 22 | Process.run("say -v #{voice} \"#{text}\"", shell: true) 23 | end 24 | -------------------------------------------------------------------------------- /examples/montreal-in-the-winter.txt: -------------------------------------------------------------------------------- 1 | Alex: Hi, how are you doing? 2 | Karen: I'm good! How about you? 3 | Alex: Good. I've been thinking about this city today. 4 | Victoria: Really? How so? 5 | Karen: Oh, Victoria, you're here! 6 | Victoria: Yes, I arrived two minutes ago. 7 | Karen: So what about this city, Alex? 8 | Alex: It's just... 9 | Alex: How Montreal in the winter inspires people to do art. -------------------------------------------------------------------------------- /examples/netflix-n-tchill.txt: -------------------------------------------------------------------------------- 1 | Thomas: Putain qu'il fait froid chez vous! 2 | Amelie: Moi aussi, j'aurais froid, avec ton manteau de printemps! 3 | Thomas: Oh laisse-moi tranquille, deux minutes. 4 | Amelie: Est-ce qu'il te reste du whisky? 5 | Thomas: Oui, j'ai mon flacon pas loin... 6 | Thomas: Est-ce que tu as des plans pour plus tard? 7 | Amelie: Non, toi? 8 | Thomas: Non. 9 | Thomas: Veux-tu venir chez moi écouter des documentaires sur Netflix? 10 | Amelie: T'es sérieux? 11 | Thomas: Quoi? 12 | Amelie: Tu me sors le netflix n tchill? 13 | Thomas: Fais comme si j'avais rien dit. -------------------------------------------------------------------------------- /how-to.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christophemarois/arguing-robots/7bd30358376aa720498d98e27f9d33b37c65d6c2/how-to.gif -------------------------------------------------------------------------------- /lain_navi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christophemarois/arguing-robots/7bd30358376aa720498d98e27f9d33b37c65d6c2/lain_navi.jpg --------------------------------------------------------------------------------