98_Text2Speech.pm: some small improvements

special Audiodevice "none" is now "default due
                   collision with new Server mode


git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@13704 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Tobias.Faust 2017-03-14 19:33:42 +00:00
parent cdcf0e5401
commit d5ba7f3c00
2 changed files with 24 additions and 9 deletions

View File

@ -1,5 +1,8 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- update: 98_Text2Speech: some small improvements
special Audiodevice "none" is now "default due
collision with new Server mode
- update: 98_DOIFtools: Improved DOIF-Operand derivation from an event line - update: 98_DOIFtools: Improved DOIF-Operand derivation from an event line
if the event monitor is opend in DOIFs detail view. if the event monitor is opend in DOIFs detail view.
Improved dialog to insert the selected operand in a definition Improved dialog to insert the selected operand in a definition

View File

@ -337,9 +337,9 @@ sub Text2Speech_OpenDev($) {
if($hash->{SSL}) { if($hash->{SSL}) {
eval "use IO::Socket::SSL"; eval "use IO::Socket::SSL";
Log3 $name, 1, $@ if($@); Log3 $name, 1, $@ if($@);
$conn = IO::Socket::SSL->new(PeerAddr => "$dev") if(!$@); $conn = IO::Socket::SSL->new(PeerAddr => "$dev", MultiHomed => 1) if(!$@);
} else { } else {
$conn = IO::Socket::INET->new(PeerAddr => $dev); $conn = IO::Socket::INET->new(PeerAddr => $dev, MultiHomed => 1);
} }
if(!$conn) { if(!$conn) {
@ -636,11 +636,19 @@ sub Text2Speech_BuildMplayerCmdString($$) {
} }
my $AlsaDevice = $hash->{ALSADEVICE}; my $AlsaDevice = $hash->{ALSADEVICE};
if($AlsaDevice eq "none") { if($AlsaDevice eq "default") {
$AlsaDevice = ""; $AlsaDevice = "";
$mplayerAudioOpts = ""; $mplayerAudioOpts = "";
} }
# anstatt mplayer wird ein anderer Player verwendet
if ($TTS_MplayerCall !~ m/mplayer/) {
$AlsaDevice = "";
$mplayerAudioOpts = "";
$mplayerNoDebug = "";
$mplayerOpts = "";
}
my $NoDebug = $mplayerNoDebug; my $NoDebug = $mplayerNoDebug;
$NoDebug = "" if($verbose >= 5); $NoDebug = "" if($verbose >= 5);
@ -652,6 +660,10 @@ sub Text2Speech_BuildMplayerCmdString($$) {
return $cmd; return $cmd;
} }
#####################################
# Benutzt um Infos aus dem Blockingprozess
# in die Readings zu schreiben
#####################################
sub Text2Speech_readingsSingleUpdateByName($$$) { sub Text2Speech_readingsSingleUpdateByName($$$) {
my ($devName, $readingName, $readingVal) = @_; my ($devName, $readingName, $readingVal) = @_;
my $hash = $defs{$devName}; my $hash = $defs{$devName};
@ -1019,14 +1031,14 @@ sub Text2Speech_WriteStats($$$$){
<code>apt-get install mplayer</code><br> <code>apt-get install mplayer</code><br>
The given alsadevice has to be configured in <code>/etc/asound.conf</code> The given alsadevice has to be configured in <code>/etc/asound.conf</code>
<p> <p>
<b>Special AlsaDevice: </b><i>none</i><br> <b>Special AlsaDevice: </b><i>default</i><br>
The internal mplayer command will be without any audio directive if the given alsadevice is <i>none</i>. The internal mplayer command will be without any audio directive if the given alsadevice is <i>default</i>.
In this case mplayer is using the standard audiodevice. In this case mplayer is using the standard audiodevice.
</p> </p>
<p> <p>
<b>Example:</b><br> <b>Example:</b><br>
<code>define MyTTS Text2Speech hw=0.0</code><br> <code>define MyTTS Text2Speech hw=0.0</code><br>
<code>define MyTTS Text2Speech none</code> <code>define MyTTS Text2Speech default</code>
</p> </p>
</ul> </ul>
</li> </li>
@ -1236,14 +1248,14 @@ sub Text2Speech_WriteStats($$$$){
<code>apt-get install mplayer</code><br> <code>apt-get install mplayer</code><br>
Das angegebene Alsadevice ist in der <code>/etc/asound.conf</code> zu konfigurieren. Das angegebene Alsadevice ist in der <code>/etc/asound.conf</code> zu konfigurieren.
<p> <p>
<b>Special AlsaDevice: </b><i>none</i><br> <b>Special AlsaDevice: </b><i>default</i><br>
Ist als Alsa-Device <i>none</i> angegeben, so wird mplayer ohne eine Audiodevice Angabe aufgerufen. Ist als Alsa-Device <i>default</i> angegeben, so wird mplayer ohne eine Audiodevice Angabe aufgerufen.
Dementsprechend verwendet mplayer das Standard Audio Ausgabedevice. Dementsprechend verwendet mplayer das Standard Audio Ausgabedevice.
</p> </p>
<p> <p>
<b>Beispiel:</b><br> <b>Beispiel:</b><br>
<code>define MyTTS Text2Speech hw=0.0</code><br> <code>define MyTTS Text2Speech hw=0.0</code><br>
<code>define MyTTS Text2Speech none</code> <code>define MyTTS Text2Speech default</code>
</p> </p>
</ul> </ul>
</li> </li>