【scipy】scipy.io.wavfile

關於scipy

Scipy高級科學計算庫:和Numpy聯繫很密切,Scipy通常都是操控Numpy數組來進行科學計算、統計分析,因此能夠說是基於Numpy之上了。Scipy有不少子模塊能夠應對不一樣的應用,例如插值運算,優化算法等等。SciPy則是在NumPy的基礎上構建的更爲強大,應用領域也更爲普遍的科學計算包。正是出於這個緣由,SciPy須要依賴NumPy的支持進行安裝和運行。html

它增長的功能包括數值積分、最優化、統計和一些專用函數。 SciPy函數庫在NumPy庫的基礎上增長了衆多的數學、科學以及工程計算中經常使用的庫函數。例如線性代數、常微分方程數值求解、信號處理、圖像處理、稀疏矩陣等等。算法

關於【Scipy文件輸入/輸出】可參考:https://blog.csdn.net/Dorisi_H_n_q/article/details/82584668數組

read

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

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.spa

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.
相關文章
相關標籤/搜索