简体   繁体   English

嵌入在 python 脚本中的声音会在另一台计算机上播放吗?

[英]Will sounds embedded in a python script play on another computer?

I am curious to know if I send someone a python file with embedded sound files, if it will still play on another computer or if the file has to be in their drive.我很想知道我是否向某人发送了一个带有嵌入声音文件的 python 文件,它是否仍然可以在另一台计算机上播放,或者该文件是否必须在他们的驱动器中。

Here I am using playsound, but I can use other modules as needed.这里我使用的是playsound,但我可以根据需要使用其他模块。

from playsound import playsound
playsound('partyhorn.wav')

The answer is no.答案是不。 The file has to be in the same relative directory.该文件必须在同一个相对目录中。

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

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