1) how to derive float from division of two integer in python?
int(var1)/int(var2) will give integer number
var1/float(var2) will give float number
2) Necessary module:
python and sound:
reading and writing audio file:
scipy.io.wavfile read, write
ploting:
matplotlib: plot, show
array manipulating:
numpy: arange, max, abs, sum
3) How to read audio files:
def readAudio(inputFile):
"""
Input:
inputFile: the path to the wav file
Output:
The function should return a numpy array that contains all samples of the audio.
"""
from scipy.io import wavfile
import numpy as np
INT16_FAC = (2**15)-1
INT32_FAC = (2**31)-1
INT64_FAC = (2**63)-1
norm_fact = {'int16':INT16_FAC, 'int32':INT32_FAC, 'int64':INT64_FAC,'float32':1.0,'float64':1.0}
fs, x = wavfile.read(inputFile)
x = np.float32(x)/norm_fact[x.dtype.name]
NOTE:
SciPy (pronounced “Sigh Pie”) is an open source Python library used by scientists, analysts, and engineers doing scientific computing and technical computing.
Blog Archive
-
▼
2015
(226)
-
▼
September
(27)
- Recurrent Neural Network
- Linux Bash Wildcards cheatsheet
- Music and Sound- Reading note
- Theodoros Giannakopoulos - Personal Web Page
- Developing an Isolated Word Recognition System in ...
- 3种方法来用慢炖锅炖牛肉
- Developing an Isolated Word Recognition System in ...
- T-Mobile is knocking $125 off the price of the iPh...
- Mooophy/Cpp-Primer
- [Studying Notes] RNN: Recurrent Neural Networks
- 不是劉墉寫的! 兒子劉軒:別再傳那篇文章了 - 生活 - 自由時報電子報
- NCIO Homepage: Special Reports: OOOPS! Looks Like ...
- 爱是有缘:麻省理工实验揭秘男女配对的真相
- Basic Troubleshooting Guide | Support | No-IP
- networking - How to make a home server using Ubunt...
- InstallingANewHardDrive - Community Help Wiki
- Yong Xu
- Secretary of Defense Ash Carter Remarks at 9/11 Me...
- VenueDB — EarMachine
- wolf totem
- Applied Speech and Audio Processing
- Assistive Context-Aware Toolkit (ACAT) | 01.org
- How to Get a Prototype Made: 4 Steps (with Picture...
- This Wearable Prototype Can See Through Skin To Sc...
- ZT 回国还是留美,先想清楚你是哪类人(深度好文)
- 农村老妈北京1000过 - 未名空间(mitbbs.com)
- python - How to split data into trainset and tests...
-
▼
September
(27)
No comments:
Post a Comment