Skip to content

Commit

Permalink
enable FullyKioskBrowser to play audio file from url
Browse files Browse the repository at this point in the history
Add sub 'play': '$device->play("http://host/file.mp3")'
  • Loading branch information
tobser authored and Tobias Sachs committed Sep 17, 2022
1 parent 5873b85 commit c67c30b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/FullyKioskBrowser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Implemented features:
- Turn display on/off
- Use text to speech on device
- Play audio from url
- With mqtt enalbed
- get remote on/off updates from device
- watch the battery level
Expand Down Expand Up @@ -45,7 +46,11 @@ Turn display on/off:
use text to speech on device
$Device1->say("The time is $Time_Now", 'en') if time_cron '30,35,40,45,50 6 * * 1-5'
$Device1->say("The time is $Time_Now", 'en') if time_cron '30,35,40,45,50 6 * * 1-5';
play audio from URL
$Device1->play("http://fileserver/audio/bing.mp3");
check battery level every 15min (Battery_Level is only available with mqtt enabled)
Expand Down Expand Up @@ -167,6 +172,12 @@ sub say {
$self->send_request("textToSpeech", text => $text, locale => $locale);
}

sub play {
my ($self, $url) = @_;
&main::print_log("FullyKiosk[$self->{_host}]: play '$url'") if $::Debug{fullykiosk};
$self->send_request("playSound", url => $url);
}

sub process_check {
my ($self) = @_;

Expand Down

0 comments on commit c67c30b

Please sign in to comment.