Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_analyzers(fs=44100.0,
nhop=512,
nffts=[1024, 2048, 4096],
mel_nband=80,
mel_freqlo=27.5,
mel_freqhi=16000.0):
analyzers = []
for nfft in nffts:
window = Windowing(size=nfft, type='blackmanharris62')
spectrum = Spectrum(size=nfft)
mel = MelBands(inputSize=(nfft // 2) + 1,
numberBands=mel_nband,
lowFrequencyBound=mel_freqlo,
highFrequencyBound=mel_freqhi,
sampleRate=fs)
analyzers.append((window, spectrum, mel))
return analyzers
def create_analyzers(fs=44100.0,
nhop=512,
nffts=[1024, 2048, 4096],
mel_nband=80,
mel_freqlo=27.5,
mel_freqhi=16000.0):
analyzers = []
for nfft in nffts:
window = Windowing(size=nfft, type='blackmanharris62')
spectrum = Spectrum(size=nfft)
mel = MelBands(inputSize=(nfft // 2) + 1,
numberBands=mel_nband,
lowFrequencyBound=mel_freqlo,
highFrequencyBound=mel_freqhi,
sampleRate=fs)
analyzers.append((window, spectrum, mel))
return analyzers
# Store the sampling rate as `sr`
#captura da musica
arq = open('/home/douglas/Música/musicas/wav/felizes/felizes.txt','r')
lines = arq.readlines()
arq.close()
lista = []
count=0
for l in lines:
#carregamento dos arquivos
music, erro = l.split("\n",1)
#VERIFIQUE O CAMINHO, POR FAVOR
# Loading audio file
print(music)
features, features_frames = es.MusicExtractor(lowlevelStats=['mean', 'stdev'],
rhythmStats=['mean', 'stdev'],
tonalStats=['mean', 'stdev'])('/home/douglas/Música/musicas/wav/felizes/'+music)
# See all feature names in the pool in a sorted order
lista.append(features['tonal.chords_strength.mean'])
print(music, features['tonal.chords_strength.mean'])
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_felizes.csv','r')
musics = arq.readlines()
arq.close()
count=0
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_felizes.csv','w')
for m in musics:
music, erro = m.split("\n",1)
print(music+","+str(lista[count])+"\n")
# 2. Load the audio as a waveform `y`
# Store the sampling rate as `sr`
#captura da musica
arq = open('/home/douglas/Música/musicas/wav/tristes/tristes.txt','r')
lines = arq.readlines()
arq.close()
lista = []
count=0
for l in lines:
#carregamento dos arquivos
music, erro = l.split("\n",1)
#VERIFIQUE O CAMINHO, POR FAVOR
# Loading audio file
features, features_frames = es.MusicExtractor(lowlevelStats=['mean', 'stdev'],
rhythmStats=['mean', 'stdev'],
tonalStats=['mean', 'stdev'])('/home/douglas/Música/musicas/wav/tristes/'+music)
# See all feature names in the pool in a sorted order
for i in range(36):
print(music, features['tonal.hpcp.mean'][i])
lista.append(features['tonal.hpcp.mean'][i])
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','r')
musics = arq.readlines()
arq.close()
count=0
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','w')
for m in musics:
# 2. Load the audio as a waveform `y`
# Store the sampling rate as `sr`
#captura da musica
arq = open('/home/douglas/Música/musicas/wav/tristes/tristes.txt','r')
lines = arq.readlines()
arq.close()
lista = []
count=0
for l in lines:
#carregamento dos arquivos
music, erro = l.split("\n",1)
#VERIFIQUE O CAMINHO, POR FAVOR
# Loading audio file
features, features_frames = es.MusicExtractor(lowlevelStats=['mean', 'stdev'],
rhythmStats=['mean', 'stdev'],
tonalStats=['mean', 'stdev'])('/home/douglas/Música/musicas/wav/tristes/'+music)
# See all feature names in the pool in a sorted order
print(music, features['lowlevel.spectral_flux.mean'])
lista.append(features['lowlevel.spectral_flux.mean'])
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','r')
musics = arq.readlines()
arq.close()
count=0
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','w')
for m in musics:
music, erro = m.split("\n",1)
# 2. Load the audio as a waveform `y`
# Store the sampling rate as `sr`
#captura da musica
arq = open('/home/douglas/Música/musicas/wav/tristes/tristes.txt','r')
lines = arq.readlines()
arq.close()
lista = []
count=0
for l in lines:
#carregamento dos arquivos
music, erro = l.split("\n",1)
#VERIFIQUE O CAMINHO, POR FAVOR
# Loading audio file
features, features_frames = es.MusicExtractor(lowlevelStats=['mean', 'stdev'],
rhythmStats=['mean', 'stdev'],
tonalStats=['mean', 'stdev'])('/home/douglas/Música/musicas/wav/tristes/'+music)
# See all feature names in the pool in a sorted order
for i in range(6):
print(music, features['lowlevel.spectral_contrast_valleys.mean'][i])
lista.append(features['lowlevel.spectral_contrast_valleys.mean'][i])
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','r')
musics = arq.readlines()
arq.close()
count=0
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','w')
for m in musics:
# 2. Load the audio as a waveform `y`
# Store the sampling rate as `sr`
#captura da musica
arq = open('/home/douglas/Música/musicas/wav/tristes/tristes.txt','r')
lines = arq.readlines()
arq.close()
lista = []
count=0
for l in lines:
#carregamento dos arquivos
music, erro = l.split("\n",1)
#VERIFIQUE O CAMINHO, POR FAVOR
# Loading audio file
features, features_frames = es.MusicExtractor(lowlevelStats=['mean', 'stdev'],
rhythmStats=['mean', 'stdev'],
tonalStats=['mean', 'stdev'])('/home/douglas/Música/musicas/wav/tristes/'+music)
# See all feature names in the pool in a sorted order
print(music,features['lowlevel.dissonance.mean'])
lista.append(features['lowlevel.dissonance.mean'])
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','r')
musics = arq.readlines()
arq.close()
count=0
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','w')
for m in musics:
music, erro = m.split("\n",1)
# 2. Load the audio as a waveform `y`
# Store the sampling rate as `sr`
#captura da musica
arq = open('/home/douglas/Música/musicas/wav/tristes/tristes.txt','r')
lines = arq.readlines()
arq.close()
lista = []
count=0
for l in lines:
#carregamento dos arquivos
music, erro = l.split("\n",1)
#VERIFIQUE O CAMINHO, POR FAVOR
# Loading audio file
features, features_frames = es.MusicExtractor(lowlevelStats=['mean', 'stdev'],
rhythmStats=['mean', 'stdev'],
tonalStats=['mean', 'stdev'])('/home/douglas/Música/musicas/wav/tristes/'+music)
# See all feature names in the pool in a sorted order
print(music,features['lowlevel.dynamic_complexity'])
lista.append(features['lowlevel.dynamic_complexity'])
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','r')
musics = arq.readlines()
arq.close()
count=0
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','w')
# 2. Load the audio as a waveform `y`
# Store the sampling rate as `sr`
#captura da musica
arq = open('/home/douglas/Música/musicas/wav/tristes/tristes.txt','r')
lines = arq.readlines()
arq.close()
lista = []
count=0
for l in lines:
#carregamento dos arquivos
music, erro = l.split("\n",1)
#VERIFIQUE O CAMINHO, POR FAVOR
# Loading audio file
features, features_frames = es.MusicExtractor(lowlevelStats=['mean', 'stdev'],
rhythmStats=['mean', 'stdev'],
tonalStats=['mean', 'stdev'])('/home/douglas/Música/musicas/wav/tristes/'+music)
# See all feature names in the pool in a sorted order
print(music, features['lowlevel.spectral_spread.mean'])
lista.append(features['lowlevel.spectral_spread.mean'])
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','r')
musics = arq.readlines()
arq.close()
count=0
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','w')
for m in musics:
music, erro = m.split("\n",1)
# 1. Get the file path to the included audio example
# 2. Load the audio as a waveform `y`
# Store the sampling rate as `sr`
#captura da musica
arq = open('/home/douglas/Música/musicas/wav/tristes/tristes.txt','r')
lines = arq.readlines()
arq.close()
lista = []
count=0
for l in lines:
music, erro = l.split("\n",1)
# Loading audio file
features, features_frames = es.MusicExtractor(lowlevelStats=['mean', 'stdev'],
rhythmStats=['mean', 'stdev'],
tonalStats=['mean', 'stdev'])('/home/douglas/Música/musicas/wav/tristes/'+music)
# See all feature names in the pool in a sorted order
print(music, lista.append(features['lowlevel.barkbands_flatness_db.mean']))
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','r')
musics = arq.readlines()
arq.close()
count=0
arq = open('/home/douglas/Documentos/tcc_code/resultado/resultados_tristes.csv','w')
for m in musics:
music, erro = m.split("\n",1)