Download data/tests/test_ttsfx.py from introvoyz045/elevenlabs-python: direct link, hf CLI and curl.
- Browser
- Download file 538 Bytes
-
https://huggingface.co/datasets/introvoyz045/elevenlabs-python/resolve/main/data/tests/test_ttsfx.py
- Command line
-
hf download hf://datasets/introvoyz045/elevenlabs-python/data/tests/test_ttsfx.py
-
curl -L -o test_ttsfx.py https://huggingface.co/datasets/introvoyz045/elevenlabs-python/resolve/main/data/tests/test_ttsfx.py
538 Bytes
| from elevenlabs.play import play | |
| from elevenlabs.client import ElevenLabs | |
| from .utils import IN_GITHUB | |
| def test_text_to_sound_effects_convert() -> None: | |
| """Test basic sound-effect generation.""" | |
| client = ElevenLabs() | |
| audio_generator = client.text_to_sound_effects.convert( | |
| text="Hypnotic throbbing sound effect. Increases in imtensity.", | |
| duration_seconds=2, | |
| ) | |
| audio = b"".join(audio_generator) | |
| assert isinstance(audio, bytes), "TTS should return bytes" | |
| if not IN_GITHUB: | |
| play(audio) | |