未验证 提交 d676d552 编写于 作者: Y YangZhou 提交者: GitHub

[audio] fix doc typo (#50343)

* fix typo

* add sox_io in audio test

* fix

* fix
上级 5d5cb256
...@@ -89,7 +89,7 @@ def load( ...@@ -89,7 +89,7 @@ def load(
Return: Return:
Tuple[paddle.Tensor, int]: (audio_content, sample rate) Tuple[paddle.Tensor, int]: (audio_content, sample rate)
Exampels: Examples:
.. code-block:: python .. code-block:: python
import os import os
......
...@@ -86,13 +86,15 @@ class TestAudioBackends(unittest.TestCase): ...@@ -86,13 +86,15 @@ class TestAudioBackends(unittest.TestCase):
np.testing.assert_array_almost_equal(wav_data, waveform) np.testing.assert_array_almost_equal(wav_data, waveform)
current_backend = paddle.audio.backends.get_current_backend() 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") paddle.audio.backends.set_backend("wave_backend")
backends = paddle.audio.backends.list_available_backends() backends = paddle.audio.backends.list_available_backends()
for backend in backends: for backend in backends:
self.assertTrue(backend in ["wave_backend", "soundfile"]) self.assertTrue(backend in ["wave_backend", "soundfile", "sox_io"])
# Test error # Test error
try: try:
...@@ -105,7 +107,9 @@ class TestAudioBackends(unittest.TestCase): ...@@ -105,7 +107,9 @@ class TestAudioBackends(unittest.TestCase):
backends = paddle.audio.backends.list_available_backends() backends = paddle.audio.backends.list_available_backends()
for backend in 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() current_backend = paddle.audio.backends.get_current_backend()
self.assertTrue(current_backend, "wave_backend") self.assertTrue(current_backend, "wave_backend")
paddleaudio.backends.set_audio_backend("soundfile") paddleaudio.backends.set_audio_backend("soundfile")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册