Spaces:
Sleeping
Sleeping
Update app.py
Browse files29 unmodified lines30313233343536373839404121 unmodified lines636465666768697029 unmodified lines if sample_rate != 16000: transform = torchaudio.transforms.Resample(orig_freq=sample_rate, new_freq=16000) waveform = transform(waveform)
# --- Amplify voice intensity here --- GAIN = 1.5 # You can adjust this value (1.0 = unchanged, 2.0 = double) waveform = waveform * GAIN waveform = torch.clamp(waveform, -1.0, 1.0) # Avoid clipping/distortion
input_values = processor(waveform.squeeze().numpy(), sampling_rate=16000, return_tensors="pt").input_values # 2. Transcribe with AI4Bharat model21 unmodified lines except Exception as e: return {"error": str(e)}
return {"error": str(e)}
with gr.Blocks() as app: gr.Markdown("## 🗣️ Hindi Reading & Pronunciation Practice App (AI4Bharat Model)")
app.py+8