From d676d55233d526f82d87b5ed2259dc6499a16ac3 Mon Sep 17 00:00:00 2001 From: YangZhou <56786796+SmileGoat@users.noreply.github.com> Date: Thu, 9 Feb 2023 15:06:23 +0800 Subject: [PATCH] [audio] fix doc typo (#50343) * fix typo * add sox_io in audio test * fix * fix --- python/paddle/audio/backends/backend.py | 2 +- python/paddle/tests/test_audio_backend.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/python/paddle/audio/backends/backend.py b/python/paddle/audio/backends/backend.py index 80c29608ee..86d15953af 100644 --- a/python/paddle/audio/backends/backend.py +++ b/python/paddle/audio/backends/backend.py @@ -89,7 +89,7 @@ def load( Return: Tuple[paddle.Tensor, int]: (audio_content, sample rate) - Exampels: + Examples: .. code-block:: python import os diff --git a/python/paddle/tests/test_audio_backend.py b/python/paddle/tests/test_audio_backend.py index 2db722df43..3390ae9b83 100644 --- a/python/paddle/tests/test_audio_backend.py +++ b/python/paddle/tests/test_audio_backend.py @@ -86,13 +86,15 @@ class TestAudioBackends(unittest.TestCase): np.testing.assert_array_almost_equal(wav_data, waveform) current_backend = paddle.audio.backends.get_current_backend() - self.assertTrue(current_backend in ["wave_backend", "soundfile"]) + self.assertTrue( + current_backend in ["wave_backend", "soundfile", "sox_io"] + ) paddle.audio.backends.set_backend("wave_backend") backends = paddle.audio.backends.list_available_backends() for backend in backends: - self.assertTrue(backend in ["wave_backend", "soundfile"]) + self.assertTrue(backend in ["wave_backend", "soundfile", "sox_io"]) # Test error try: @@ -105,7 +107,9 @@ class TestAudioBackends(unittest.TestCase): backends = paddle.audio.backends.list_available_backends() for backend in backends: - self.assertTrue(backend in ["wave_backend", "soundfile"]) + self.assertTrue( + backend in ["wave_backend", "soundfile", "sox_io"] + ) current_backend = paddle.audio.backends.get_current_backend() self.assertTrue(current_backend, "wave_backend") paddleaudio.backends.set_audio_backend("soundfile") -- GitLab