Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to get the duration of audio python

import wave
import contextlib
fname = '/tmp/test.wav'
with contextlib.closing(wave.open(fname,'r')) as f:
    frames = f.getnframes()
    rate = f.getframerate()
    duration = frames / float(rate)
    print(duration)
Comment

PREVIOUS NEXT
Code Example
Python :: norm in python 
Python :: how to hide tensorflow warnings 
Python :: children beautiful soup 
Python :: matplotlib dateformatter x axis 
Python :: django python base 64 decode 
Python :: how to get input from user in python with out press enter 
Python :: try catch python 
Python :: how to make a python function 
Python :: how to remove an element in a list by index python 
Python :: how to get the author on discord.py 
Python :: Python datetime to string using strftime() 
Python :: def function in python 
Python :: How to loop over grouped Pandas dataframe? 
Python :: how to iterate through a list in python 
Python :: python path to python executable 
Python :: python replace nth occurrence in string 
Python :: django set session variable 
Python :: __new__ python 
Python :: python null 
Python :: flask debugtoolbar 
Python :: install coverage python 
Python :: herencia python 
Python :: add caption to plot python 
Python :: python input code 
Python :: python rgb to hex 
Python :: python submit work to redis 
Python :: reset_index(drop=true) 
Python :: UTC to ISO 8601 with TimeZone information (Python 3): 
Python :: python turtle triangle 
Python :: random int python 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =