kostacivos/kostacivos/player.py

15 lines
295 B
Python

#!/usr/bin/env python3
import pyaudio
import struttura
def player(songa):
volume = songa.volume
onda = songa.waveform
p = pyaudio.PyAudio()
stream = p.open(format=pyaudio.paFloat32, channels=1, rate=fs, output=True)
stream.write(volume*onda)
stream.stop_stream()