简体   繁体   English

如何在 python 中使用带有 winsound 的多进程库?

[英]How do I use the multiprocess library with winsound in python?

I am writing a basic piano style program that uses functions with winsound.Beep to play different note.我正在编写一个基本的钢琴风格程序,该程序使用带有 winsound.Beep 的函数来播放不同的音符。 I am new to multi-processing, and was wondering how I would be able to play two notes at once.我是多处理的新手,想知道如何一次演奏两个音符。 If that is not possible, perhaps there is a way to combine frequencies that I do not know.如果这是不可能的,也许有一种方法可以组合我不知道的频率。 Thanks for reading ~Jimnebob感谢阅读~Jimnebob

It seems like Beep function couldn't play several notes at the same time. Beep 功能好像不能同时播放多个音符。 You can record the sound of 'Beep' through sounddevice library, save the sound in wav files.您可以通过声音设备库录制“哔”的声音,并将声音保存在 wav 文件中。 Then, use subprocess.Popen to achieve multiprocess.然后,使用 subprocess.Popen 实现多进程。 The subprocess would play the wav files.子进程将播放 wav 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM