Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Liver64 committed Feb 2, 2022
1 parent c63a8fc commit 553f740
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 17 deletions.
12 changes: 12 additions & 0 deletions bin/output.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NULL - Discard all samples (playback) or generate zero samples (capture)
ALSA - default Audio Device
ALSA - sysdefault Audio Device
ALSA - dmix: sample mixing device DEV=0
ALSA - dmix: sample mixing device DEV=1
ALSA - dsnoop: direct sample snooping device DEV=0
ALSA - dsnoop: sample snooping device DEV=1
ALSA - hw: Direct hardware device without any conversions DEV=0
ALSA - hw: Direct hardware device without any conversions DEV=1
ALSA - plughw: Hardware device with all software conversions DEV=0
ALSA - plughw: Hardware device with all software conversions DEV=1
USB - USB Soundcard
3 changes: 1 addition & 2 deletions config/output.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ ALSA - hw: Direct hardware device without any conversions DEV=0
ALSA - hw: Direct hardware device without any conversions DEV=1
ALSA - plughw: Hardware device with all software conversions DEV=0
ALSA - plughw: Hardware device with all software conversions DEV=1
USB - USB Soundkarte CARD=1
USB - USB Soundkarte CARD=2
USB - USB Soundcard
4 changes: 4 additions & 0 deletions postupgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ PBIN=$LBPBIN/$PDIR
echo "<INFO> Copy back existing config files"
cp -p -v -r /tmp/$1\_upgrade/config/$3/* $5/config/plugins/$3/

echo "<INFO> Replace output.cfg config"
rm -r $5/config/plugins/$3/output.cfg
cp -p -v -r $5/bin/plugins/$3/output.cfg $5/config/plugins/$3/output.cfg

echo "<INFO> Copy back existing log files"
cp -p -v -r /tmp/$1\_upgrade/log/$3/* $5/log/plugins/$3/

Expand Down
19 changes: 16 additions & 3 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ <h2 class="auto-style3" style="width: 100%"></h2>
<script>
$('#out_list').val('<TMPL_VAR SYSTEM.card>');
</script>


</td>
<div id="loginResult" style="display:none;"></div>
<div id="msg"></div>
Expand Down Expand Up @@ -308,7 +306,22 @@ <h2 class="auto-style3" style="width: 100%"></h2>
<script>
$('#usb_list').val('<TMPL_VAR SYSTEM.usbcard>');
</script>
<td class="collapse_usb" style="height: 30px; width: 60px;">

<td class="collapse_usb" style="height: 30px; width: 30px;">
<label id="lusb"><TMPL_VAR T2S.USB_CARDNO></label>
</td>
<td class="collapse_usb" width="19%">
<select id="usbcardno" name="usbcardno" data-mini="true" data-native-menu="false" width="20%">
<!--<option value="0">0</option>-->
<option selected="selected" value="1">1</option>
<option value="2">2</option>
</select>
<script>
$('#usbcardno option[value="<TMPL_VAR SYSTEM.usbcardno>"').prop('selected', 'selected');
</script>
</td>

<td class="collapse_usb" style="height: 30px; width: 30px;">
<label id="lusb"><TMPL_VAR T2S.USB_DEVICE></label>
</td>
<td class="collapse_usb" width="19%">
Expand Down
3 changes: 2 additions & 1 deletion templates/lang/tts_all_de.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ VOICE_ERROR2="Der API-key"
VOICE_ERROR3="ist nicht valide.\n Fehler Text: Stimmenliste konnte nicht geladen werden!"
AZURE_API_LINK="Hilfe für Erstellung des API-Keys (Bitte auch das Preismodell beachten)"
PROBLEMS_WITH_API_KEY="Mit dem API-key scheint etwas nicht zu stimmen!"
USB_DEVICE="Device (DEV):"
USB_DEVICE="Device:"
USB_CARDNO="Card:"
TTS_INSTANZ="Text-to-Speech (T2S) Instanz:"
TTS_LANGUAGE="Standardsprache/-stimme für T2S:"
VALIDATE_JINGLE="Bitte Jingle Datei für T2S auswählen!"
Expand Down
1 change: 1 addition & 0 deletions templates/lang/tts_all_en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ VOICE_ERROR3="seems to be invalid.\n Error Text: Cannot get voice list!"
AZURE_API_LINK="How to get the API-Key (Please check pricing upfront)"
PROBLEMS_WITH_API_KEY="Something is wrong with the API-key!"
USB_DEVICE="Device (DEV):"
USB_CARDNO="Card:"
TTS_INSTANZ="select text-to-speech (T2S) Provider:"
TTS_LANGUAGE="Standard language / voice for T2S:"
VALIDATE_JINGLE="Please select Jingle file (playgong=yes) for T2S"
Expand Down
24 changes: 15 additions & 9 deletions webfrontend/html/tts.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

include("helper.php");
include('logging.php');
require_once('output/soundcards.php');

// setze korrekte Zeitzone
date_default_timezone_set(date("e"));
Expand Down Expand Up @@ -69,6 +70,10 @@
];
$log = LBLog::newLog($params);

#$t = New soundCard();
#$e = $t->listSoundCards();
#print_r($e);

// used for single logging
$plugindata = LBSystem::plugindata();

Expand Down Expand Up @@ -220,19 +225,17 @@
alsa_ob();
break;
case '012': // USB Soundcard 1
//require_once('output/usb.php');
require_once('output/alsa.php');
$deviceno = $config['SYSTEM']['usbdevice'];
getusbcard();
shell_exec("export AUDIODEV=".$myteccard.",1,".$deviceno);
#echo "export AUDIODEV=".$myteccard;
shell_exec("export AUDIODEV=".$myteccard);
alsa_ob();
break;
case '013': // USB Soundcard 2
//require_once('output/usb.php');
require_once('output/alsa.php');
$deviceno = $config['SYSTEM']['usbdevice'];
getusbcard();
shell_exec("export AUDIODEV=".$myteccard.",2,".$deviceno);
#echo "export AUDIODEV=".$myteccard;
shell_exec("export AUDIODEV=".$myteccard);
alsa_ob();
break;
default; // Soundcard bcm2835
Expand Down Expand Up @@ -272,10 +275,13 @@ function getusbcard() {
$json = file_get_contents($lbpbindir."/hats.json");
$cfg = json_decode($json, True);
$mycard = $config['SYSTEM']['usbcard'];
$myteccard = $cfg[$mycard]['output'];
return($myteccard);
if ($mycard == "usb_audio") {
$myteccard = $cfg[$mycard]['output'].$config['SYSTEM']['usbcardno'].','.$config['SYSTEM']['usbdevice'];
} else {
$myteccard = $cfg[$mycard]['output'].',DEV='.$config['SYSTEM']['usbdevice'];
}
return $myteccard;
}


/**
* Function : create_tts --> creates an MP3 File based on Text Input
Expand Down
10 changes: 8 additions & 2 deletions webfrontend/htmlauth/index.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ my $azureregion = "westeurope"; # Change here if you have a Azure API key fo
#my $urlfile = "https://raw.githubusercontent.com/Liver64/LoxBerry-Sonos/master/webfrontend/html/release/info.txt";
my $log = LoxBerry::Log->new (
name => 'Webinterface',
# filename => $lbplogdir ."/". $pluginlogfile,
# append => 1,
#filename => $lbplogdir ."/". $pluginlogfile,
#append => 1,
addtime => 1
);
my $helplink = "https://www.loxwiki.eu/x/uoFYAg";
Expand All @@ -119,9 +119,14 @@ if (!defined $pcfg->param("MP3.splitsentences")) {
if (!defined $pcfg->param("SYSTEM.usbdevice")) {
$pcfg->param("SYSTEM.usbdevice", 0);
$pcfg->save() or &error;
}# USB card No.
if (!defined $pcfg->param("SYSTEM.usbcardno")) {
$pcfg->param("SYSTEM.usbcardno", 1);
$pcfg->save() or &error;
}



##########################################################################
# Read Settings
##########################################################################
Expand Down Expand Up @@ -452,6 +457,7 @@ sub save
$pcfg->param("SYSTEM.card", "$R::out_list");
$pcfg->param("SYSTEM.usbcard", "$R::usb_list");
$pcfg->param("SYSTEM.usbdevice", "$R::usbdeviceno");
$pcfg->param("SYSTEM.usbcardno", "$R::usbcardno");
$pcfg->param("TTS.volume", "$R::volume");

LOGINF "Writing configuration file";
Expand Down

0 comments on commit 553f740

Please sign in to comment.