mirror of
https://github.com/arcctgx/ARver
synced 2025-06-04 14:33:46 +02:00
Some checks are pending
Sync mirrors / sync-gitlab (push) Waiting to run
Sync mirrors / sync-codeberg (push) Waiting to run
Unit tests / unit-tests (3.10) (push) Waiting to run
Unit tests / unit-tests (3.11) (push) Waiting to run
Unit tests / unit-tests (3.12) (push) Waiting to run
Unit tests / unit-tests (3.7) (push) Waiting to run
Unit tests / unit-tests (3.8) (push) Waiting to run
Unit tests / unit-tests (3.9) (push) Waiting to run
I forgot to rename it in 7887623
.
26 lines
781 B
Python
26 lines
781 B
Python
"""Tests of getting audio file properties."""
|
|
|
|
# pylint: disable=missing-function-docstring
|
|
|
|
import os
|
|
import unittest
|
|
|
|
from arver.audio.properties import get_frame_count
|
|
|
|
CWD = os.path.abspath(os.path.dirname(__file__))
|
|
SAMPLE_WAV_PATH = CWD + '/data/samples/sample.wav'
|
|
SAMPLE_FLAC_PATH = CWD + '/data/samples/sample.flac'
|
|
|
|
|
|
class TestGetFrameCount(unittest.TestCase):
|
|
"""Test getting the number of audio frames."""
|
|
|
|
expected_frames = 44100 # one second of CDDA audio: number of frames same as sampling rate
|
|
|
|
def test_wav(self):
|
|
frames = get_frame_count(SAMPLE_WAV_PATH)
|
|
self.assertEqual(frames, self.expected_frames)
|
|
|
|
def test_flac(self):
|
|
frames = get_frame_count(SAMPLE_FLAC_PATH)
|
|
self.assertEqual(frames, self.expected_frames)
|