Deepfilternet
Deepfilternet
The below process is about running of deepfilternet display clear or not based on
noisy score and counting fillers in an telugu audio.
spectrogram = torchaudio.transforms.Spectrogram()(enhanced)
spectral_energy = torch.mean(spectrogram.pow(2), dim=0)
normalized_energy = spectral_energy / torch.max(spectral_energy)
return average_noisy_energy
telugu_fillers = []
for filler in english_fillers:
translated_filler = translate_text(filler, 'en', 'te')
if translated_filler:
telugu_fillers.append(translated_filler)
else:
telugu_fillers.append(filler) # fallback to the original text
recognizer = sr.Recognizer()
audio_chunks = segment_audio(audio_path, chunk_length_ms)
text_segments = []
for i, chunk in enumerate(audio_chunks):
chunk_name = f"/tmp/chunk{i}.wav"
chunk.export(chunk_name, format="wav")
text = recognize_audio_chunk(chunk_name, recognizer)
if text:
text_segments.append(text)
os.remove(chunk_name) # Clean up temporary chunk file
filler_count = Counter()
total_fillers = sum(filler_count.values())
print(f"Total fillers detected: {total_fillers}")
audio_file = "/content/drive/MyDrive/input.wav"