Как определять наличие звука в аудио?
У меня в плане записывать звук с игры, и сразу же (отрывок -0.5 сек. макс.) искать необходимый звук.
#-3519
import numpy as np
from scipy.io.wavfile import read
import matplotlib.pyplot as plt
# read audio samples
input_data = read("recorded.wav")
audio = input_data[1]
catch = audio[730000:750000]
plt.plot(audio)
# label the axes
plt.ylabel("Amplitude")
plt.xlabel("Time")
# set the title
plt.title("Sample Wav")
# display the plot
plt.show()
print(np.array_equal(audio[690000:750000],catch))
print(np.sum(catch))
print('Finished')
На графике с кода запись звука с игры (19 сек.) , пример необходимого звука - переменная catch.
Аудио: https://drive.google.com/file/d/1lXZVxSsMX7tzHzwRjgEqLydGGBCw95gC/view?usp=sharing