GithubHelp home page GithubHelp logo

compare_audio's Introduction

Audio Comparison App

This is a simple Flask web application for comparing audio files based on their MFCC (Mel-Frequency Cepstral Coefficients) features using cosine similarity. The application allows users to upload two audio files and set a similarity threshold. The server then compares the audio files and returns whether they are deemed similar or not based on the specified threshold.

Getting Started

Prerequisites

Make sure you have Python installed on your system. You can install the required Python packages using the following command:

pip install flask librosa numpy scikit-learn

Running the Application

  1. Clone the repository:
git clone https://github.com/refaldyrk/compare_audio.git
cd compare_audio
  1. Run the Flask application:
python app.py

The application will be accessible at http://127.0.0.1:5000/ in your web browser.

API Endpoint

/compare_audio (POST)

  • Parameters:
    • base_audio: The base audio file (required).
    • input_audio: The input audio file (required).
  • Response:
    • JSON object with the result of the comparison.
{
  "result": "similar" or "not similar"
}

Example Usage

import requests
import os

url = "http://127.0.0.1:5000/compare_audio"
files = {
    "base_audio": open("path/to/base_audio.wav", "rb"),
    "input_audio": open("path/to/input_audio.wav", "rb"),
}
response = requests.post(url, files=files)
result = response.json()

print(f"The audio files are {result['result']}.")

compare_audio's People

Contributors

refaldyrk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.