56
1
SW
7.2.7.4
EXAMPLE SCRIPT04:
Play an Internet radio station when the Internet connection is restored
The following
script
loads a
preset
when an available Internet connection (WAN) is
detected. It can be good to use this in combination with the silence detection event:
The device is playing an Internet radio station, however, due to a network problem, it no
longer has access to the radio. After a few seconds without audio, the silence detection
event is triggered, and the device starts playing content from the uSD card (back-up
music). However, you want the radio that was playing to start up again automatically once
the Internet connection is available again.
Figure 56
require "PLAYER"
ep = PLAYER.new()
ep.PLAYER_open({preset=2})