【scipy】scipy.io.wavfile

关于scipy

Scipy高级科学计算库:和Numpy联系很密切,Scipy一般都是操控Numpy数组来进行科学计算、统计分析,所以可以说是基于Numpy之上了。Scipy有很多子模块可以应对不同的应用,例如插值运算,优化算法等等。SciPy则是在NumPy的基础上构建的更为强大,应用领域也更为广泛的科学计算包。正是出于这个原因,SciPy需要依赖NumPy的支持进行安装和运行。

它增加的功能包括数值积分、最优化、统计和一些专用函数。 SciPy函数库在NumPy库的基础上增加了众多的数学、科学以及工程计算中常用的库函数。例如线性代数、常微分方程数值求解、信号处理、图像处理、稀疏矩阵等等。

关于【Scipy文件输入/输出】可参考:https://blog.csdn.net/Dorisi_H_n_q/article/details/82584668

read

scipy.io.wavfile.read(filename, mmap=False)

Open a WAV file. Return the sample rate (in samples/sec) and data from a WAV file.

Parameters
filename   [string or open file handle]   Input wav file.
mmap  [bool, optional]   Whether to read data as memory-mapped. Only to be used on real files (Default: False).  New in version 0.12.0.
Returns
rate   [int]   Sample rate of wav file.
data  [numpy array]  Data read from wav file. Data-type is determined from the file; see Notes.

write

scipy.io.wavfile.write(filename, rate, data)

Write a numpy array as a WAV file.

filename [string or open file handle]   Output wav file.
rate [int]   The sample rate (in samples/sec).
data [ndarray]    A 1-D or 2-D numpy array of either integer or float data-type.
posted @ 2019-12-31 15:43  Skye_Zhao  阅读(3816)  评论(0编辑  收藏  举报