Skip to content

Instantly share code, notes, and snippets.

Aravind Pai aravindpai

Block or report user

Report or block aravindpai

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View distribution.py
import matplotlib.pyplot as plt
plt.hist(energy)
plt.show()
View ste.py
import numpy as np
energy = np.array([sum(abs(x[i:i+window_length]**2)) for i in range(0, len(x), window_length)])
View energy.py
energy = sum(abs(a**2))
print(energy)
View listen.py
import IPython.display as ipd
a=x[21*window_length:22*window_length]
ipd.Audio(a, rate=sr)
View duration.py
int(librosa.get_duration(x, sr)/60)
View window.py
max_slice=5
window_length = max_slice * sr
View read.py
filename='powerplay.wav'
import librosa
x, sr = librosa.load(filename,sr=16000)
View viz.py
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(14, 8))
ax1 = fig.add_subplot(211)
ax1.set_xlabel('time')
ax1.set_ylabel('Amplitude')
ax1.plot(a)
View final.py
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
start=np.array(df['start'])
end=np.array(df['end'])
for i in range(len(df)):
if(i!=0):
start_lim = start[i] - 5
else:
 start_lim = start[i] 
end_lim   = end[i]   
filename="highlight" + str(i+1) + ".mp4"
View highlight.py
temp=[]
i=0
j=0
n=len(df) - 2
m=len(df) - 1
while(i<=n):
j=i+1
 while(j<=m):
if(df['end'][i] == df['start'][j]):
df.loc[i,'end'] = df.loc[j,'end']
You can’t perform that action at this time.