f0cal / google-coral

Community gathering point for Google Coral dev board and dongle knowledge.
109 stars 14 forks source link

Play wav sound #82

Closed laurentdebricon closed 4 years ago

laurentdebricon commented 4 years ago

How to play a wav file through the 3.5mm audio jack

it looks simple but i am failing hard :(

laurentdebricon commented 4 years ago
#!/usr/bin/env python3

from playsound import playsound

def playy():
    playsound('xylofon.wav')

from threading import Thread
T = Thread(target=playy) # create thread
T.start() # Launch created thread    

while True:
    print('cool')
laurentdebricon commented 4 years ago

I checked first that everything was ok with this simple command : speaker-test -c 2 -t wav