Skip to content

Talabov/Audio-Duration-Format-Analyzer-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Audio Duration & Format Analyzer API

✔️ 100% Tested and Verified: Works in Docker Desktop on Windows, Linux, and MacOS.
Spin up your own audio analysis API in seconds, with zero local setup!


✅ Key Features

  • 🎧 Upload: mp3, wav, flac, m4a, opus, ogg, aac, wma, ac3, mid
  • ⏱ Instantly returns duration (seconds) and MIME type
  • 🚦 Strict input validation (type, size, empty file)
  • 🗑 Auto-delete after analysis (no file storage)
  • 🌍 CORS-enabled, clean modular structure
  • 🧪 Postman & Docker tested

🚀 Endpoint

POST /analyze

  • Body: form-data
    • file (type: File) — your audio file

Example Response

{
  "duration_seconds": 257.91,
  "format": "audio/mpeg"
}

⚠️ Errors

  • Unsupported file type:
    {"error": "Unsupported file type: .txt"}
  • No file/empty file:
    {"error": "No file part"}
  • File too large (max 15MB):
    {"error": "File too large. Max size is 15MB."}

⚙️ Requirements (for manual run)

pip install -r requirements.txt
python app.py

🐳 Docker Support (Recommended)

Run anywhere — one command deploy!

docker build -t audio-analyzer .
docker run -d -p 5000:5000 audio-analyzer

API will be available at:
http://localhost:5000/


🖥 Example Screenshots

  • Server running
  • Postman request & response
  • Console logs (duration & format)

See /screens/ for real usage.


💡 You can see real examples on the Gumroad gallery.


💼 Ready-to-Use Version

You can get a ZIP version with all files, setup instructions, .env.example, and more:

👉 Buy it on Gumroad


📬 Contacts


Need this in another stack (Node.js, Go, etc)?
Email or Telegram — custom dev available.


This project is fully tested and verified in Docker.
Build, run, and deploy with confidence.

About

Turn audio into data: get duration & MIME via fast Flask API. Ready to deploy.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published