Skip to content

APIs and Controller

Raef Maroof edited this page Dec 8, 2022 · 27 revisions

Identify Song Clip - Query Custom ML Model

Flask API endpoint to save audio clip and call our machine learning model. Requires the audio file of a sound clip. Returns the identified song title.

Endpoint: POST /postAudio/

Request Parameters (Multipart Form):

Key Value
audio 16-bit mono pcm audio file to identify

Returns (JSON): Response title of input audio clip

Key Type Value
songName String The title of the song identified by the ML model.

Response Codes:

Response Code Interpretation
200 OK Successfully identified the song; name supplied in return JSON.
404 Bad Request Invalid request format.

Get Song's Movie Information

Flask API endpoint to retrieve relevant movie/song information. Returns information for movies that contain a given song.

Endpoint: POST /getsongs/

Request Parameters:

Key Value
songName The name of the song on which movie data is desired.

Returns (JSON):

Key Type Value
movies Array of String Arrays An array of movie information that contain the song passed in the request body.

Here's a breakdown of the arrays contained in movies:

Index Type Value
0 String The name of the movie.
1 String The year the movie was released.
2 String The director of the movie.
3 String Link to movie poster.

Response Codes:

Response Code Interpretation
200 OK Successfully located related movies and associated data. Returns json results as above.
400 Bad Request Invalid request format.
404 Not Found Unrecognized song.

Interactions with 3rd party SDKs, APIs, and Apps

Open Song in 3rd Party Apps

Ability to open up song/movie [info] in other applications (e.g. spotify, youtube, google). Query apps with the ability to play songs via Intents. Allow user to select one of the responding apps on the current phone.

Clone this wiki locally