Skip to content

Instantly share code, notes, and snippets.



Last active May 19, 2016
What would you like to do?
# coding: utf-8
pip install sounddevice
pip install soundfile
baixe esse arquivo de audio e renomeie para: audio.ogg
import sounddevice as sd
import soundfile as sf
# todos dispositivos de audio
devices = sd.query_devices(kind='output')
# abre um arquivo de audio
data, fs ='audio.ogg', dtype='float32')
# pulse audio on my system
selected_device = devices[6]['name'].encode("utf-8")
# toca o audio
# device precisa ser uma string, com unicode não funciona., blocking=True, device=selected_device)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment