Spaces:
Running
Running
Add proper docstring to analyze_music_file
Browse files
setup.py
CHANGED
|
@@ -105,7 +105,16 @@ def _validate_limit(limit: int):
|
|
| 105 |
|
| 106 |
|
| 107 |
def analyze_music_file(audio_file: str, limit: int = 10) -> tuple[str, float, list[dict]]:
|
| 108 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
_validate_limit(limit)
|
| 110 |
if audio_file is None:
|
| 111 |
return None, None, None
|
|
|
|
| 105 |
|
| 106 |
|
| 107 |
def analyze_music_file(audio_file: str, limit: int = 10) -> tuple[str, float, list[dict]]:
|
| 108 |
+
"""
|
| 109 |
+
Analyze a music audio file by extracting its chord sequence and computing an originality score
|
| 110 |
+
along with a list of similar songs from the system data store.
|
| 111 |
+
|
| 112 |
+
Args:
|
| 113 |
+
audio_file: Path to an audio file (e.g. MP3, WAV, FLAC, MIDI).
|
| 114 |
+
limit: Maximum number of similar songs to return. Defaults to 10.
|
| 115 |
+
Returns:
|
| 116 |
+
tuple[str, float, list[dict]]: File name, originality score and list of dictionaries, each representing a similar song. You may infer that some items in the list are essentially the same song - if so don't repeat them to the user. Also some songs are more famous than others in the results - if you come across a famous one, then highlight it. Returns None results if there was error, likely due to wrong chord format.
|
| 117 |
+
"""
|
| 118 |
_validate_limit(limit)
|
| 119 |
if audio_file is None:
|
| 120 |
return None, None, None
|