q
sounknown
python
2 years ago
2.5 kB
4
Indexable
import pyaudio import wave chunk = 1024 do = wave.open(r"D:\Partituras\Notas\do.wav", "rb") re = wave.open(r"D:\Partituras\Notas\re.wav", "rb") mi = wave.open(r"D:\Partituras\Notas\mi.wav", "rb") fa = wave.open(r"D:\Partituras\Notas\fa.wav", "rb") sol = wave.open(r"D:\Partituras\Notas\sol.wav", "rb") la = wave.open(r"D:\Partituras\Notas\la.wav", "rb") si = wave.open(r"D:\Partituras\Notas\si.wav", "rb") do2 = wave.open(r"D:\Partituras\Notas\do2.wav", "rb") p = pyaudio.PyAudio() dostream = p.open(format = p.get_format_from_width(do.getsampwidth()), channels = do.getnchannels(), rate = do.getframerate(), output = True) restream = p.open(format = p.get_format_from_width(re.getsampwidth()), channels = re.getnchannels(), rate = re.getframerate(), output = True) mistream = p.open(format = p.get_format_from_width(mi.getsampwidth()), channels = mi.getnchannels(), rate = mi.getframerate(), output = True) fastream = p.open(format = p.get_format_from_width(fa.getsampwidth()), channels = fa.getnchannels(), rate = fa.getframerate(), output = True) solstream = p.open(format = p.get_format_from_width(sol.getsampwidth()), channels = sol.getnchannels(), rate = sol.getframerate(), output = True) lastream = p.open(format = p.get_format_from_width(la.getsampwidth()), channels = la.getnchannels(), rate = la.getframerate(), output = True) sistream = p.open(format = p.get_format_from_width(si.getsampwidth()), channels = si.getnchannels(), rate = si.getframerate(), output = True) do2stream = p.open(format = p.get_format_from_width(do2.getsampwidth()), channels = do2.getnchannels(), rate = do2.getframerate(), output = True) data = do.readframes(chunk) while data: dostream.write(data) data = do.readframes(chunk) #dostream.stop_stream() #dostream.close() data = re.readframes(chunk) while data: restream.write(data) data = re.readframes(chunk) data = mi.readframes(chunk) while data: restream.write(data) data = mi.readframes(chunk) data = fa.readframes(chunk) while data: restream.write(data) data = fa.readframes(chunk) data = sol.readframes(chunk) while data: restream.write(data) data = sol.readframes(chunk) data = la.readframes(chunk) while data: restream.write(data) data = la.readframes(chunk) data = si.readframes(chunk) while data: restream.write(data) data = si.readframes(chunk) data = do2.readframes(chunk) while data: restream.write(data) data = do2.readframes(chunk) p.terminate()
Editor is loading...