3

I changed chronos-text-to-speech-notify acording to https://github.com/dxknight/chronos/issues/2.

My Chronos config includes this:

(setq chronos-text-to-speech-program-parameters "-s 50 -k 1 -a 50 -v mb/mb-fr1" ).

The command

(chronos-add-timer "0:0:1" "Coucou, je parle français" nil)

is supposed to speak the message with a French voice, but it doesn't (default English voice only)

Chronos sent this shell command:

espeak \"-s 50 -k 1 -a 50 -v mb/mb-fr1\" \"20:44 Coucou, je parle français\"

which returned

Failed to read voice 'mb/mb-fr1"'

This shell command works fine, however:

espeak -s 50 -k 1 -a 50 -v mb/mb-fr1 "20:44 Coucou, je parle français"

This sounds like a bug, but I haven't succeeded in fixing it.

Drew
  • 77,472
  • 10
  • 114
  • 243
gigiair
  • 2,166
  • 1
  • 9
  • 15
  • Maybe give a link for, and a short description of, Chronos? – Drew Nov 07 '19 at 22:27
  • What is the question? So far, this risks being closed as unclear. Please pose an explicit question. Thx. – Drew Nov 07 '19 at 22:29
  • 1
    I'm not sure what the fix is, but I suspect there's a difference between espeak "-arg1 -arg2" "some text here" and espeak -arg1 -arg2 "some text here". In my first example, -arg1 -arg2 is in quotes; the second one isn't. – zck Nov 07 '19 at 23:26
  • @Drew
    Chronos provides multiple countdown / countup timers, shown sorted by expiry time in a special buffer chronos. Homepage: http://github.com/dxknight/chronos.
    – gigiair Nov 08 '19 at 05:33
  • @Drew The question is to correct chronos-text-to-speech-notify so that he speaks French. I think we need to review chronos - shell-command to send a functional command – gigiair Nov 08 '19 at 05:46
  • That's not a question; it's a request for (who?) to correct something you think needs correcting. If you do actually have a question, please put it in the posted question, explicitly. Comments can be deleted at any time. – Drew Nov 08 '19 at 18:09

1 Answers1

2

Following a look at chronos.el

(setq chronos-text-to-speech-program-parameters 
      "-s 50 -k 1 -a 50 -v mb/mb-fr1")

should probably be:

(setq chronos-text-to-speech-program-parameters
      '("-s" "50" "-k" "1" "-a" "50" "-v" "mb/mb-fr1"))

It looks buggy in that it's not passing the arguments through shell-quote-argument, although it's unclear if there's actually any reason to be using start-process-shell-command (as opposed to start-process). Either way I suspect there are improvements which could be made upstream.

phils
  • 50,977
  • 3
  • 79
  • 122
  • thats do not make any change – gigiair Nov 08 '19 at 05:27
  • It absolutely makes a difference to the shell command which is called. If you're not seeing the difference in the quoting, then you've not tested correctly. If you do see the difference in the command, yet the outcome is the same, then my assumption about the cause of the problem was incorrect. – phils Nov 08 '19 at 05:36
  • The command I see using my suggested change matches the format you've shown after the "This shell command works fine, however" part of the question. – phils Nov 08 '19 at 05:40
  • 1
    Ok, whith your suggestion, chronos speak french. sorry for the noise – gigiair Nov 08 '19 at 09:18