def Water():
Frames = 1024
Sound = wave.open("C:\\Users\\braro\\Documents\\UTN\\I Cuatri\\Principios de Programación\\PycharmProjects\\CO-Proyect"
"\\BattleshipsSounds\\Sounds\\Water.wav", 'rb')
Repro = pyaudio.PyAudio()
stream = Repro.open(
format=Repro.get_format_from_width(Sound.getsampwidth()),
channels=Sound.getnchannels(),
rate=Sound.getframerate(),
output=True)
data = Sound.readframes(
Frames)
while data != b'':
stream.write(data)
data = Sound.readframes(Frames)
stream.close()
Repro.terminate()
评论列表
文章目录