y, sr = librosa.load("audio_countdown.wav")import matplotlib.pyplot as plt
print(f'y: {y[:10]}')print(f'shape y: {y.shape}')print(f'sr: {sr}')import pandas as pd
pd.Series(y).plot(figsize=(10,5),lw=1,title='Raw Audio Example')
plt.show()
import numpy as np
import matplotlib.pyplot as plt
D = librosa.stft(y)
S_db = librosa.amplitude_to_db(np.abs(D), ref=np.max)
S_db.shape
fig, ax = plt.subplots(figsize=(10,5))
img = librosa.display.specshow(S_db,x_axis='time',y_axis='log',ax=ax)
ax.set_title('Spectogram Example', fontsize=20)
fig.colorbar(img, ax=ax,format=f'%0.2f')
plt.show()
web请求类题目,要求1000次
import requests
from bs4 import BeautifulSoup
import time
urlhttp://ad7bc925-bc7a-4881-8a75-9045b60d4ab2.node5.buuoj.cn:81/index.php
srequests.session() #维持会话
datas.get(url)
for i in range(1001):soupBeautifulSoup(d…