Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
flatsiedatsie authored Feb 20, 2022
1 parent 6ae0b07 commit 5f7a1cc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
}
},
"short_name": "Radio",
"version": "2.1.3",
"version": "2.1.4",
"web_accessible_resources": [
"css/*.css",
"images/*.svg",
Expand Down
31 changes: 22 additions & 9 deletions pkg/internet_radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,21 +731,33 @@ def set_radio_state(self,power):
kill_process('ffplay')

if bt_connected:
my_command = ('SDL_AUDIODRIVER="alsa"','AUDIODEV="bluealsa:DEV=' + self.bluetooth_device_mac + '"','ffplay', '-nodisp', '-vn', '-infbuf','-autoexit', str(self.persistent_data['current_stream_url']),'-volume',str(self.persistent_data['volume']))
my_command = "SDL_AUDIODRIVER=alsa UDIODEV=bluealsa:DEV=" + str(self.bluetooth_device_mac) + " ffplay -nodisp -vn -infbuf -autoexit " + str(self.persistent_data['current_stream_url']) + " -volume " + str(self.persistent_data['volume'])

if self.DEBUG:
print("Internet radio addon will call this subprocess command: " + str(my_command))
print("starting ffplay...")
self.player = subprocess.Popen(my_command,
env=environment,
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)


else:
#my_command = "ffplay -nodisp -vn -infbuf -autoexit" + str(self.persistent_data['current_stream_url']) + " -volume " + str(self.persistent_data['volume'])
my_command = ("ffplay", "-nodisp", "-vn", "-infbuf","-autoexit", str(self.persistent_data['current_stream_url']),"-volume",str(self.persistent_data['volume']))



if self.DEBUG:
print("Internet radio addon will call this subprocess command: " + str(my_command))
print("starting ffplay...")
self.player = subprocess.Popen(my_command,
env=environment,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
if self.DEBUG:
print("Internet radio addon will call this subprocess command: " + str(my_command))
print("starting ffplay...")
self.player = subprocess.Popen(my_command,
env=environment,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)

if self.persistent_data['playing'] == False:
try:
Expand Down Expand Up @@ -802,6 +814,7 @@ def set_radio_state(self,power):
self.get_artist() # sets now_playing data to none on the device and UI
if self.player != None:
self.player.terminate()
os.system('pkill ffplay')

else:
if self.DEBUG:
Expand Down

0 comments on commit 5f7a1cc

Please sign in to comment.