0

我正在使用 winsound 模块播放文件夹中的音频文件,并尝试为我正在处理的项目创建脚本系统。但目前我的制作过程很慢,如下:

运行代码:

  • print()音频文件中的语音与功能速度不匹配
  • time.sleep()向上或向下更改时间
  • 重复前面的步骤

有没有更快的方法来创建它?也许通过反复改变打印语句的速度来实时匹配音频文件的速度?

我正在使用 python 3.8,所以如果有任何模块可以做到这一点,那将有很大帮助。

此外,如果有帮助,这里是代码示例:

import winsound

print("You find the access tunnel, hidden within a natural cave a mile off the main road.")
time.sleep(2)
print(" ")
print("You don't need the keycard. The door is ajar.")
time.sleep(2)
print(" ")
print("It smells here. It smells like them. Hopefully, they've moved on. You've come so far
already. You can't turn back now.")
4

0 回答 0