Found better way to play sound
This commit is contained in:
@ -8,14 +8,8 @@ Created on Fri Jan 8 10:26:56 2021
|
|||||||
|
|
||||||
from os import system
|
from os import system
|
||||||
from sys import platform
|
from sys import platform
|
||||||
|
import simpleaudio as sa
|
||||||
sound_args = ""
|
|
||||||
|
|
||||||
def play_sound(file):
|
def play_sound(file):
|
||||||
if platform == "win32" or platform == "win64" or platform == "cygwin":
|
wave_obj = sa.WaveObject.from_wave_file(file)
|
||||||
cmd = "wmplayer " + '"' + file + '"'
|
play_obj = wave_obj.play()
|
||||||
else:
|
|
||||||
cmd = "aplay -N " + sound_args + " " + file + " &"
|
|
||||||
# print(cmd)
|
|
||||||
system(cmd)
|
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ sudo apt-get -y --ignore-missing install gpsd gpsd-clients gpsbabel libgps-dev p
|
|||||||
# Python addons
|
# Python addons
|
||||||
sudo -H pip3 install --upgrade pip
|
sudo -H pip3 install --upgrade pip
|
||||||
sudo -H pip3 install configparser pyside2
|
sudo -H pip3 install configparser pyside2
|
||||||
sudo -H pip3 install --upgrade pyserial numpy plotly scapy scipy gps gpxpy maidenhead pyyaml virtualenv virtualenvwrapper
|
sudo -H pip3 install --upgrade pyserial numpy plotly scapy==2.4.4 scipy gps gpxpy maidenhead pyyaml virtualenv virtualenvwrapper simpleaudio
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
sudo apt-get autoremove
|
sudo apt-get autoremove
|
||||||
|
|||||||
Reference in New Issue
Block a user