当前位置:网站首页>Wave view audio information
Wave view audio information
2022-06-12 02:22:00 【weixin_ forty-five million nine hundred and sixty-five thousand】
View audio information
import wave
def info_wav(wavFile):
f = wave.open(wavFile)
# Audio head Parameters
params = f.getparams()
Channels = f.getnchannels()
SampleRate = f.getframerate()
bit_type = f.getsampwidth() * 8
frames = f.getnframes()
# Duration That is, the audio duration = Number of sampling points / Sampling rate
Duration = wav_time = frames / float(SampleRate) # Unit is s
# Print
print(" Audio head parameters :", params)
print(" The channel number (Channels):", Channels)
print(" Sampling rate (SampleRate):", SampleRate)
print(" The bit (Precision):", bit_type)
print(" Number of sampling points (frames):", frames)
print(" Number of frames or time (Duration):", Duration)
# test
wavFile = r'1.wav'
info_wav(wavFile)
边栏推荐
- El upload upload file
- Graduation design of fire hydrant monitoring system --- thesis (add the most comprehensive hardware circuit design - > driver design - > Alibaba cloud Internet of things construction - > Android App D
- Force deduction solution summary 1022- sum of binary numbers from root to leaf
- 2022 Fujian Provincial Safety Officer C certificate (full-time safety officer) examination simulation 100 questions and answers
- SQL calculates KS, AUC, IV, psi and other risk control model indicators
- How WPS inserts a directory and the operating steps for quickly inserting a directory
- Force deduction solution summary 473 match to square
- 力扣解法汇总1022-从根到叶的二进制数之和
- 力扣解法汇总398-随机数索引
- What insurance products can you buy at the age of 60?
猜你喜欢

DDD的分层架构
![[adjustment] notice on the opening of the 2022 pre adjustment system for postgraduate enrollment of Shanghai Second University of Technology](/img/16/2f9a235995cdd54ac9b85a68a7afcb.jpg)
[adjustment] notice on the opening of the 2022 pre adjustment system for postgraduate enrollment of Shanghai Second University of Technology

maya前台渲染插件mel脚本工具

Cvpr2022 | IFS RCNN: an incremental small sample instance splitter

How WPS inserts a directory and the operating steps for quickly inserting a directory

Graphical data analysis | data analysis tool map

Master of a famous school has been working hard for 5 years. AI has no paper. How can the tutor free range?

matplotlib. pyplot. Bar chart (II)

程序员应该如何解决买菜难问题?手把手带你利用无障碍辅助功能快速下单抢菜

SQL calculates KS, AUC, IV, psi and other risk control model indicators
随机推荐
Does the virtual host have independent IP
Graphic data analysis | business cognition and data exploration
What insurance products can you buy at the age of 60?
How to make div 100% page (not screen) height- How to make a div 100% of page (not screen) height?
Depth copy
ACL 2022 | 预训练语言模型和图文模型的强强联合
MySQL advanced knowledge points
力扣解法汇总436-寻找右区间
Ozzanmation action system based on SSE
Force deduction solution summary 713- subarray with product less than k
[no title] 2022 coal mine safety inspection test questions and online simulation test
Acl2022 | DCSR: a sentence aware contrastive learning method for open domain paragraph retrieval
Start stop script and distribution script of shell
RPA introduction
力扣解法汇总面试题 01.05. 一次编辑
Force deduction solution summary 467- unique substring in surrounding string
How can low code platforms improve cost effectiveness?
Navicat for MySQL 11 Linux 破解方法
力扣解法汇总450-删除二叉搜索树中的节点
力扣解法汇总358-迷你语法分析器