python 读写 pickle文件

Jan. 15, 2020, 5:25 p.m.

read: 1270

以python3为例
注意:python3 与 python2 默认生成的pickle文件不通用,你得加上参数, 即协议版本, 以下样例不加协议:

# 写入文件
with open('1.pickle', 'wb') as f:
    pickle.dump(self.key_dict, f)
# 读取文件
with open('1.pickle', 'rb') as f:
    key_dict = pickle.load(f)




使用ffmpeg对wav文件进行降采样

依赖pysoundfile,ffmpeg把采样率大于16k的wav文件降采样为16k速度比使用librosa快很多,适合批量处理的情况不适合在Windows环境下运行更快读取sr的优化可以参考这个文…

浮点数格式

文章标题:浮点数格式文章内容:

此站点由 ASP.NETIIS 驱动 | © 2018-2023 hupeng.me. All Rights Reserved.