rename samples/ to test_audio, and move it to tests/

This commit is contained in:
Joel Mathew Thomas
2025-01-11 03:24:05 +05:30
parent 65fefe5ace
commit 5164e2cebd
9 changed files with 7 additions and 7 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -3
View File
@@ -3,11 +3,11 @@ from src.input.file_reader import read_audio
from src.input.format_checker import is_supported_format
def test_read_audio():
file_path = "samples/cafe_crowd_talk.aiff"
file_path = "tests/test_audio/cafe_crowd_talk.aiff"
audio, sr = read_audio(file_path)
assert len(audio) > 0
assert sr > 0
def test_is_supported_format():
assert is_supported_format("samples/cafe_crowd_talk.aiff") == True
assert is_supported_format("samples/unsupported_file.txt") == False
assert is_supported_format("tests/test_audio/cafe_crowd_talk.aiff") == True
assert is_supported_format("tests/test_audio/unsupported_file.txt") == False
+3 -3
View File
@@ -8,7 +8,7 @@ from src.input.file_reader import read_audio
from src.preprocessing.resample import resample
def test_normalize_audio():
file_path = "samples/cafe_crowd_talk.aiff"
file_path = "tests/test_audio/cafe_crowd_talk.aiff"
audio, _ = read_audio(file_path)
normalized_audio = normalize_audio(audio)
@@ -16,14 +16,14 @@ def test_normalize_audio():
assert normalized_audio.min() >= -1.0
def test_trim_audio():
file_path = "samples/cafe_crowd_talk.aiff"
file_path = "tests/test_audio/cafe_crowd_talk.aiff"
audio, sr = read_audio(file_path)
trimmed_audio = trim_audio(audio, sr)
assert len(trimmed_audio) <= len(audio)
def test_classify():
file_path = "samples/cafe_crowd_talk.wav"
file_path = "tests/test_audio/cafe_crowd_talk.wav"
expected_class = "Speech"
predicted_class = classify_audio(file_path)
+1 -1
View File
@@ -14,7 +14,7 @@ def test_demucs_separation_with_preprocessing():
Test to ensure Demucs separation works with preprocessing and creates expected outputs.
"""
input_file = "./samples/am_contra_heart_peripheral.wav"
input_file = "tests/test_audio/am_contra_heart_peripheral.wav"
file_name = Path(input_file).stem
output_path = "/tmp/demucs-test"
waveform, samplerate = read_audio(input_file)