SNOM: Unterschied zwischen den Versionen

Aus FHEMWiki
(Die Seite wurde neu angelegt: „== Durchsage == FFMPEG bauen: http://www.jeffreythompson.org/blog/2014/11/13/installing-ffmpeg-for-raspberry-pi/ Snom Freigabe auf seite ...? erster test: f…“)
 
Zeile 7: Zeile 7:
erster test: ffmpeg -re -i "/opt/fhem/cache/d08c473c8d5f7f1b7ac252ce80d0b12a.mp3" -filter_complex 'aresample=8000,asetnsamples=n=160,volume=0.25' -acodec pcm_mulaw -ac 1 -vn -f rtp rtp://IP:PORT
erster test: ffmpeg -re -i "/opt/fhem/cache/d08c473c8d5f7f1b7ac252ce80d0b12a.mp3" -filter_complex 'aresample=8000,asetnsamples=n=160,volume=0.25' -acodec pcm_mulaw -ac 1 -vn -f rtp rtp://IP:PORT


Dann noch sudo freigeben:
fhem    ALL=NOPASSWD: /usr/local/bin/ffmpeg *
fhem    ALL=NOPASSWD: /usr/local/bin/ffmpeg *
Ein notify mit dateinamen erzeugen lassen:
    readingsSingleUpdate($hash, "file", $file, 1); in 98_Text2Speech.pm einbauen
<nowiki>  if(-e $file) { # Datei existiert jetzt
    readingsSingleUpdate($hash, "file", $file, 1);
    $cmd = Text2Speech_BuildMplayerCmdString($hash, $file);
    Log3 $hash->{NAME}, 4, "Text2Speech: " .$cmd;
    system($cmd);
  }
</nowiki>
und das Notify anlegen:
<nowiki>
MyTTS {
  my $command = (substr($EVENT, 0, 4));;
  my $value = (substr($EVENT, 6,(length($EVENT)-1)));;
  Log 1, "$EVENT";;
  if($command eq "file") {
    Log 1, "$value";;
    system('ffmpeg -re -i /opt/fhem/"' . $value . '" -filter_complex "aresample=8000,asetnsamples=n=160,volume=0.25" -acodec pcm_mulaw -ac 1 -vn -f rtp rtp://IP:PORT');
  }
}
</nowiki>
Bei mir ist die Podcast IP:PORT 238.255.255.252:5432 im 192.168er Netz...

Version vom 1. April 2016, 13:12 Uhr

Durchsage

FFMPEG bauen: http://www.jeffreythompson.org/blog/2014/11/13/installing-ffmpeg-for-raspberry-pi/

Snom Freigabe auf seite ...?

erster test: ffmpeg -re -i "/opt/fhem/cache/d08c473c8d5f7f1b7ac252ce80d0b12a.mp3" -filter_complex 'aresample=8000,asetnsamples=n=160,volume=0.25' -acodec pcm_mulaw -ac 1 -vn -f rtp rtp://IP:PORT


Dann noch sudo freigeben: fhem ALL=NOPASSWD: /usr/local/bin/ffmpeg *

Ein notify mit dateinamen erzeugen lassen:

   readingsSingleUpdate($hash, "file", $file, 1); in 98_Text2Speech.pm einbauen

if(-e $file) { # Datei existiert jetzt readingsSingleUpdate($hash, "file", $file, 1); $cmd = Text2Speech_BuildMplayerCmdString($hash, $file); Log3 $hash->{NAME}, 4, "Text2Speech: " .$cmd; system($cmd); }

und das Notify anlegen: MyTTS { my $command = (substr($EVENT, 0, 4));; my $value = (substr($EVENT, 6,(length($EVENT)-1)));; Log 1, "$EVENT";; if($command eq "file") { Log 1, "$value";; system('ffmpeg -re -i /opt/fhem/"' . $value . '" -filter_complex "aresample=8000,asetnsamples=n=160,volume=0.25" -acodec pcm_mulaw -ac 1 -vn -f rtp rtp://IP:PORT'); } }

Bei mir ist die Podcast IP:PORT 238.255.255.252:5432 im 192.168er Netz...