背景
最近在用 CI130X 离在线的SDK测试串口采音(采用Opus压缩),然后用 deepSeek 写了一段 python 测试脚本;
由于采集得到的是Opus格式的数据,最后生成的文件也是 Opus 格式的文件,因此需要写一个脚本进行解码,其中用到了 opuslib 库。
一、下载opuslib库
1、先在命令行cd到自己Python所在目录路径
2、运行以下指令
python.exe -m pip install opuslib
二、运行代码出现错误
raise Exception(
'Could not find Opus library. Make sure it is installed.')
Exception: Could not find Opus library. Make sure it is installed.
三、解决方案--下载opus.dll文件
1、 下载链接:Releases · ShiftMediaProject/opus

2、解压找到 XXX\libopus_v1.4_msvc17\bin\x64 目录下的opus.dll文件并复制
3、粘贴到C:\Windows\System32目录下
4、运行代码发现不会继续报错,大功告成!
转载自:
https://blog.csdn.net/m0_72838674/article/details/148142608