Logo Les Interros des Lycées
doppler1.py
Programme Python de l'Interros des Lycées
from pyaudio import PyAudio
def play_samples(samples, sample_rate=22050):
    p = PyAudio()
    stream = p.open(format=p.get_format_from_width(1),
                    channels=1,
                    rate=sample_rate,
                    output=True)
    stream.write(int8(samples))
    stream.stop_stream()
    stream.close()
    p.terminate()