diff --git a/api/length_detector.py b/api/length_detector.py index 1b5c6bf..830e44a 100644 --- a/api/length_detector.py +++ b/api/length_detector.py @@ -7,7 +7,7 @@ def find_length(filename): # Get the duration of our audiofile in seconds with librosa get_duration method. duration = librosa.get_duration(y=y, sr=sr) file_duration = seconds_to_minutes(duration) - return f'Your audio file is {file_duration} long.' + return file_duration # The seconds_to_minutes function takes time in float as an argument and converts it to string giving its time in minutes and seconds. diff --git a/api/tempo_detector.py b/api/tempo_detector.py index 4e97ab9..8d4bf0a 100644 --- a/api/tempo_detector.py +++ b/api/tempo_detector.py @@ -8,7 +8,7 @@ def find_tempo(filename): # librosa.beat.beat_track is used to calculate the tempo of the audio file based on its beat frames, which are stored in beat_frames. tempo, beat_frames = librosa.beat.beat_track(y=y, sr=sr) file_tempo = format_tempo(tempo) - return f'Your audio file tempo is of {file_tempo} bpm.' + return file_tempo # format_tempo takes a floating-point number and returns a string representation of that number with two decimal places. def format_tempo(float):