Skip to main content

Audio Quality Checker API

Assess the perceptual quality of an uploaded audio file. Returns an overall quality score, speech detection, background noise level, volume, and clipping/distortion signals.

Base URL

https://api.genderrecognition.com

Endpoint

POST /v1/audio/quality/api

Headers

apiKey: YOUR_API_KEY
Content-Type: multipart/form-data

Body

FieldTypeRequiredDescription
filefileYesAudio file to analyze.

Example

curl -X POST "https://api.genderrecognition.com/v1/audio/quality/api" \
-H "apiKey: YOUR_API_KEY" \
-F "file=@audio.wav"

Response

{
"success": true,
"quality_score": 82,
"quality_label": "good",
"mos_score": 4.1,
"speech": {
"detected": true,
"duration": 4.8,
"ratio": 92
},
"noise": {
"level": "low",
"snr_db": 28.4
},
"volume": {
"too_quiet": false,
"rms_dbfs": -18.2
},
"clipping": {
"detected": false,
"ratio": 0
},
"audio": {
"duration": 5.2,
"sample_rate": 44100,
"channels": 1
},
"remainingRequests": 119
}

Response fields

FieldTypeDescription
successbooleantrue when the audio was processed successfully.
quality_scoreinteger or nullOverall perceptual quality, 0-100. null when no speech is detected.
quality_labelstring or nullQuality bucket for quality_score: excellent, good, fair, or poor. null when quality_score is null.
mos_scorenumber or nullRaw predicted Mean Opinion Score, 1-5 (higher is better). null when no speech is detected.
speech.detectedbooleanWhether any speech was found in the file.
speech.durationnumberSeconds of audio classified as speech.
speech.ratiointegerPercentage of the file that is speech, 0-100.
noise.levelstring or nullBackground noise bucket: low, medium, or high. null when it can't be measured (for example, no non-speech audio to compare against).
noise.snr_dbnumber or nullSignal-to-noise ratio in dB, comparing speech to background noise. null under the same conditions as noise.level.
volume.too_quietbooleantrue when the audio is too quiet to be reliably used.
volume.rms_dbfsnumberLoudness in dBFS. 0 is the loudest possible level; more negative values are quieter.
clipping.detectedbooleantrue when clipping/distortion was detected.
clipping.ratiointegerPercentage of audio samples affected by clipping, 0-100.
audio.durationnumberDuration of the uploaded file in seconds.
audio.sample_ratenumberSample rate of the uploaded audio, in Hz.
audio.channelsnumberNumber of audio channels (1 = mono, 2 = stereo).
remainingRequestsintegerAPI requests remaining after this successful request is deducted.

quality_score, speech.ratio, and clipping.ratio are whole-number percentages. noise.snr_db and volume.rms_dbfs are decibel values, not percentages.

Error cases

Missing API key

{ "error": "API key is required" }

Invalid API key

{ "error": "Invalid API key" }

Missing file

{ "error": "No file uploaded" }

File too large

{ "error": "File too large" }

Unexpected field

Returned when the file is uploaded under a field name other than file (for example, sending an extra file):

{ "error": "Unexpected field" }

Invalid file type

{
"error": "Invalid file type. Allowed formats: WAV, MP3, FLAC, MP4, OGG, AIFF"
}

Audio conversion failed

Returned when the file has an allowed extension but ffmpeg cannot convert it (for example, a corrupt or unreadable file):

{ "error": "Audio conversion failed: <details>" }

Quota exceeded

{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "You have exceeded your free tier limit of 50 requests.",
"detailedMessage": "Insufficient remaining requests. Required: 1, Available: 0",
"details": {
"limit": 50,
"used": 50,
"reset_date": "2026-07-01T00:00:00.000Z"
},
"suggested_action": "Please upgrade to a premium plan to continue using the API."
}
}

Processing failed

{ "error": "Audio quality assessment failed" }

Notes

  • The backend accepts many common audio formats, including WAV, MP3, M4A, FLAC, OGG, WebM, AAC, Opus, WMA, AMR, 3GP, AIFF, AU, and more, and converts non-WAV files before analysis.
  • Audio uploads use the file field and must be 10 MB or smaller.
  • A request is deducted only after the quality assessment completes successfully.