Noise Cancellation
Remove background noise from your audio files with our AI-powered denoising service. Our models are trained on millions of hours of audio to deliver crystal-clear speech while preserving natural voice characteristics.
Overview
Our Noise Cancellation API uses advanced deep learning to intelligently separate speech from background noise in real-time. The models are optimized for various noise environments including traffic, wind, keyboard typing, air conditioning, and crowd noise.
- Full file denoising for complete audio processing
- Chunk-based processing for custom pipelines
- WebSocket streaming for real-time applications
Listen to before & after:
Explore our denoising capabilities to enhance your audio quality.
API Usage
Denoise complete audio files using our REST API endpoint with simple HTTP requests.
Denoise Audio File - Basic Request
Upload an audio file and receive the denoised version directly as a WAV file.
curl -X POST "https://api.fonada.ai/denoise" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@noisy_audio.wav" \
--output clean_audio.wavRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file | ✓ | Audio file to denoise (WAV, MP3, FLAC, OGG) |
Response Format
Returns the denoised audio file directly (WAV format) with the following headers:
X-Original-Sample-Rate: Original sample rate (Hz)
X-Audio-Duration: Duration in seconds
X-Processing-Time-Ms: Processing time
X-Credits-Used: Credits deducted
API Endpoint
Base URL: https://api.fonada.ai
Endpoint: /denoise
Method: POST
Content-Type: multipart/form-data
Fonadalabs SDK
Get richer denoising experiences with our official Python SDK. Install once and access high-level modules for file processing, streaming, and batch workflows.
Install the SDK
pip install fonadalabsDenoise a Single File
Use the high-level HTTP client to process local recordings. The SDK reads credentials from .env, keeping them out of source control.
from fonadalabs import DenoiseHttpClient
# Initialize client
client = DenoiseHttpClient(api_key="YOUR_API_KEY")
# Denoise a file
denoised_audio = client.denoise_file(
file_path="noisy_audio.wav",
output_path="clean_audio.wav" # Optional: saves automatically
)
print("Audio denoised successfully!")Chunk Denoising (HTTP)
Process audio in small chunks for real-time streaming or custom pipelines. Each chunk is denoised independently so you can stitch responses together.
Python SDK - Single Chunk
from fonadalabs import DenoiseStreamingClient
import numpy as np
client = DenoiseStreamingClient(api_key="YOUR_API_KEY")
# Denoise a single chunk (5,120 samples = 320ms at 16kHz)
audio_chunk = np.random.randn(5120).astype(np.float32) # 320ms chunk
denoised_chunk = client.denoise_chunk(audio_chunk, chunk_size_ms=320)
print(f"Chunk denoised: {len(denoised_chunk)} samples")cURL Example
# Encode your audio chunk as base64
CHUNK_B64=$(base64 -w0 audio_chunk.raw)
curl -X POST "https://api.fonada.ai/denoise_chunk" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chunk_data": "'$CHUNK_B64'",
"codec": "pcm_f32le",
"chunk_size_ms": 320
}'
# Optional: chunk_size_ms can be 160, 320 (default), or 640Response Format (JSON)
{
"success": true,
"denoised_chunk": "BASE64_ENCODED_AUDIO",
"request_id": "abc123",
"batch_size": 1,
"inference_ms": 15.5
}Note: HTTP chunk endpoint returns JSON with base64-encoded audio. WebSocket streaming returns raw binary audio chunks directly for lower latency.
Chunk Size Selection
| Size | Samples | Latency | Quality | Use Case |
|---|---|---|---|---|
| 160ms | 2,560 | Lowest | Good | Ultra-low latency voice |
| 320ms | 5,120 | Medium | Better | Real-time calls (recommended) |
| 640ms | 10,240 | Higher | Best | Batch processing, recordings |
Recommendation: Use 320ms for most real-time applications. Use 640ms for highest quality when latency is not critical.
WebSocket Streaming
Real-time audio denoising for live calls, voice chat, and streaming applications with ultra-low latency.
📡 WebSocket Endpoint
wss://api.fonada.ai/ws/denoise_chunkPython SDK - WebSocket
from fonadalabs import DenoiseStreamingClient
client = DenoiseStreamingClient(api_key="YOUR_API_KEY")
# Callback for each denoised chunk
def on_chunk_ready(chunk):
# Play or save the denoised chunk
print(f"Received {len(chunk)} samples")
# Stream denoise a file
denoised = client.denoise_file_ws(
file_path="noisy_audio.wav",
output_path="clean_audio.wav",
callback=on_chunk_ready
)
print("Streaming complete!")WebSocket Protocol
- Connect to
wss://api.fonada.ai/ws/denoise_chunk - Receive connection confirmation
- Send authentication:
{"api_key": "YOUR_KEY", "codec": "pcm_f32le", "chunk_size_ms": 320} - Receive authentication confirmation
- Send binary audio chunks (supported: 2,560 / 5,120 / 10,240 float32 samples for 160ms / 320ms / 640ms)
- Receive denoised binary chunks
- Send
{"action": "close"}when done
WebSocket Benefits
- • Real-time streaming: Audio starts processing while still being sent
- • Lower latency: Perfect for live calls and voice chat
- • Efficient bandwidth: Progressive audio delivery
- • Binary output: Returns raw binary audio (not base64-encoded JSON) for maximum efficiency
Health Check
Check if the API is running and available before processing audio.
Check API Status
curl "https://api.fonada.ai/health"Response
{
"status": "healthy",
"engine_loaded": true,
"active_requests": 5,
"max_concurrent_requests": 40,
"available_slots": 35
}Supported Formats
Our denoising service supports multiple audio formats with automatic resampling.
| Parameter | Requirement |
|---|---|
| Format | WAV (recommended), MP3, FLAC, OGG |
| Sample Rate | Any (auto-resampled to 16kHz internally) |
| Channels | Mono or Stereo (converted to mono) |
| Bit Depth | 16-bit, 24-bit, or 32-bit float |
| Max Duration | 60 seconds per request |
| Max File Size | 50 MB |
Best Practices
Follow these recommendations to achieve optimal denoising results.
📁 File Processing
- • Keep audio under 60 seconds - split longer files into chunks
- • Use WAV format for best quality (MP3 compression can affect results)
- • Store API keys securely - never hardcode in client-side code
Performance
- • Use WebSocket streaming for real-time applications
- • Implement retry logic for 429 (rate limit) and 500 (server) errors
- • Check health endpoint before processing large batches
Error Handling
- • Handle 400 errors for audio exceeding 60 second limit
- • Handle 401 errors by checking API key validity
- • Handle 402 errors by adding credits to your account
- • Monitor API rate limits (varies by tier - check your console)