''Talking domoticz''

Forum dédié aux questions concernant la configuration de votre serveur sous Linux
MelloXVI
Messages : 113
Inscription : 28 avr. 2015, 20:17

''Talking domoticz''

Message par MelloXVI »

Bonsoir, j'essaye d'installer Talking Domoticz, avec ce tuto : http://www.domoticz.com/wiki/Talking_Domoticz
Tout ce passe très bien jusqu’a ce que je tape : ''sudo amixer cset numid=3 1'', ici je vois que ca ne fonctionne pas, puisque j'ai :

numid=3,iface=MIXER,name='PCM Playback Route'
; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
: values=1


Si je test avec ''espeak hello', j'obtient directement :

ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started



Une idée ? =)
jackslayter
Messages : 1040
Inscription : 30 sept. 2014, 14:40
Localisation : Isère (38)

Re: ''Talking domoticz''

Message par jackslayter »

Essaye de forcer la sortie audio dans raspi-config
Raspberry Pi + RFLink + Domoticz Beta
Oregon - 3x Thgr122Nx / Chacon - micromodule 200w, télécommande 3b et 16b, 2x module 1000w, détecteur de fumée, contact de porte, 2x prise 3500w / OWL - CM180 / TRC02 v2 RGB 3M / Cheap - PIR, contact de porte
MelloXVI
Messages : 113
Inscription : 28 avr. 2015, 20:17

Re: ''Talking domoticz''

Message par MelloXVI »

Je vais essayer de faire ca ! Merci

Neanmoins j'ai fais le test sans avois branché de jack dans cette derniere.... Ça vient peut être de là aussi :lol:
MelloXVI
Messages : 113
Inscription : 28 avr. 2015, 20:17

Re: ''Talking domoticz''

Message par MelloXVI »

Finalement, j'ai installé mpg123, ca va parfaitement :D

Merci
MelloXVI
Messages : 113
Inscription : 28 avr. 2015, 20:17

Re: ''Talking domoticz''

Message par MelloXVI »

Finalement j'aimerais pas mal qu'espeak marche, je n'arrrive pas à faire ce que je veux avec mpg123 ...

J'ai tout reinstallé, et j'obtiens maintenant
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started

Meme apres avoir forcé la sortie audio

Une idée ?
MelloXVI
Messages : 113
Inscription : 28 avr. 2015, 20:17

Re: ''Talking domoticz''

Message par MelloXVI »

J'ai trouvé une autre solution, si ca interesse quelqu'un =)

Il faut mettre ce bout de code

Code : Tout sélectionner

#! /bin/bash
INPUT=$*
STRINGNUM=0
 
ary=($INPUT)

for key in "${!ary[@]}" 
  do
    SHORTTMP[$STRINGNUM]="${SHORTTMP[$STRINGNUM]} ${ary[$key]}"
    LENGTH=$(echo ${#SHORTTMP[$STRINGNUM]})
    #echo "word:$key, ${ary[$key]}"
    #echo "adding to: $STRINGNUM"
    if [[ "$LENGTH" -lt "100" ]]; then
      #echo starting new line
      SHORT[$STRINGNUM]=${SHORTTMP[$STRINGNUM]}
    else
      STRINGNUM=$(($STRINGNUM+1))
      SHORTTMP[$STRINGNUM]="${ary[$key]}"
      SHORT[$STRINGNUM]="${ary[$key]}"
    fi
done
 
for key in "${!SHORT[@]}"
  do
    #echo "line: $key is: ${SHORT[$key]}"
 
    echo "Playing line: $(($key+1)) of $(($STRINGNUM+1))"
    NEXTURL=$(echo ${SHORT[$key]} | xxd -plain | tr -d '\n' | sed 's/\(..\)/%\1/g')
    mpg123 -q "http://translate.google.com/translate_tts?tl=fr&q=$NEXTURL"
echo "C'est fait"

done
dans un fichier qu'on appel par exemple parle.sh

On peut ensuite le lancer par ligne de commande en faisant :

Code : Tout sélectionner

./parle.sh LE TEXTE
On peut aussi faire parler directement un interrupteur ou tout autre choses, en appelant :

Code : Tout sélectionner

script:///home/pi/parle.sh LE TEXTE
Cette technique à marché pendant une petite semaine, maintenant il me renvoie :

Code : Tout sélectionner

HTTP request failed: 503 Service Unavailable
[mpg123.c:606] error: Access to http resource http://translate.google.com/translate_tts?tl=fr&q=%62%6c%61%0a failed.
Une idée ?
Dernière modification par MelloXVI le 02 août 2015, 12:08, modifié 1 fois.
vil1driver
Messages : 5661
Inscription : 30 janv. 2015, 11:07
Localisation : Rennes (35)

Re: ''Talking domoticz''

Message par vil1driver »

salut,

si tu tapes directement l'adresse dans ton navigateur tu vas tout de suite comprendre le problème :D

effectivement c'est google qui coince et non ton script, d'ailleurs merci pour le partage...

je te propose de passer par le service voxygene qui offre des voix formidables

dans ton script remplaces

Code : Tout sélectionner

http://translate.google.com/translate_tts?tl=fr&q=$NEXTURL
par

Code : Tout sélectionner

http://www.voxygen.fr/sites/all/modules/voxygen_voices/assets/proxy/index.php?method=redirect&text=$NEXTURL&voice=Eva
à la fin de cette adresse 'Eva' est le nom de la voix, les choix possibles sont les suivants:

DarkVadoor
Melodine
Chut
Sorciere
Robot
Yeti
Electra

ce service est en principe payant, je pense qu'un jour cette adresse sera bloquée mais en attendant, c'est du bonheur
MAJ = VIDER LE CACHE(<-Clicable)
/!\Les mises à jour de Domoticz sont souvent sources de difficultés, ne sautez pas dessus
modules.lua

Un ex domoticzien
MelloXVI
Messages : 113
Inscription : 28 avr. 2015, 20:17

Re: ''Talking domoticz''

Message par MelloXVI »

Merci Vil pour le partage. J'essaye ça en rentrant ! Ça a l'air beaucoup mieu !
MelloXVI
Messages : 113
Inscription : 28 avr. 2015, 20:17

Re: ''Talking domoticz''

Message par MelloXVI »

Hello, j'ai testé, et voila ce que j'obtiens :

Code : Tout sélectionner

NOTE: no complete URL in redirect, constructing one
NOTE: no complete URL in redirect, constructing one
NOTE: no complete URL in redirect, constructing one
NOTE: no complete URL in redirect, constructing one
NOTE: no complete URL in redirect, constructing one
NOTE: no complete URL in redirect, constructing one
NOTE: no complete URL in redirect, constructing one
HTTP request failed: 400 Bad request
[mpg123.c:606] error: Access to http resource http://www.voxygen.fr/sites/all/modules/voxygen_voices/assets/proxy/index.php?method=redirect&text=%74%65%73%74%0a&voice=Eva failed.
Une idée ? Merci pour ton aide =)
EDIT :J'ai mis ''https'' et j'ai obtenu :

Code : Tout sélectionner

[mpg123.c:629] error: Cannot open https://www.voxygen.fr/sites/all/modules/voxygen_voices/assets/proxy/index.php?----method=redirect&text=%6d%65%6c%6c%6f%0a&voice=Eva: File access error. (code 22)
vil1driver
Messages : 5661
Inscription : 30 janv. 2015, 11:07
Localisation : Rennes (35)

Re: ''Talking domoticz''

Message par vil1driver »

lorsque je tapes cette adresse dans mon navigateur, j'entends bien 'test', et toi ?
MAJ = VIDER LE CACHE(<-Clicable)
/!\Les mises à jour de Domoticz sont souvent sources de difficultés, ne sautez pas dessus
modules.lua

Un ex domoticzien
Répondre