![](/img/trans.png)
[英]How to create a exe file for python program with spacy without using pyinstaller?
[英]How to get a working EXE file using pyinstaller with the sounddevice module in Python
不幸的是pyinstaller的sounddevice模块有问题。
我写了下面的代码,但是当我使用pyinstaller创建EXE文件时,dist文件夹中的EXE文件不起作用。 使用pyinstaller的制作过程成功完成,但是EXE文件不起作用。
代码是:
import sounddevice as sd
fs=44100
duration =2 # seconds
print('Start')
myrecording = sd.rec(duration * fs, samplerate=fs, channels=2,dtype='float64')
sd.wait()
print('play')
sd.play(myrecording, fs)
print('end')
所选答案无效,但有所帮助。
对我来说,有效的解决方案是在.exe文件所在的位置添加_sounddevice_data文件夹,然后在其中创建一个portaudio-binaries文件夹,最后将libportaudio64bit.dll放入最近创建的文件夹中。
希望能帮助到你!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.