File tree Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Original file line number Diff line number Diff line change 1111async def test_stt_convert ():
1212 """Test basic speech-to-text conversion."""
1313 client = ElevenLabs ()
14-
14+
1515 audio_file = open (DEFAULT_VOICE_FILE , "rb" )
16-
16+
1717 transcription = client .speech_to_text .convert (
1818 file = audio_file ,
1919 model_id = "scribe_v1"
2020 )
21-
21+
2222 assert isinstance (transcription .text , str )
2323 assert len (transcription .text ) > 0
2424 assert isinstance (transcription .words , list )
2525 assert len (transcription .words ) > 0
26-
27- @pytest .mark .asyncio
28- async def test_stt_convert_as_stream ():
29- """Test speech-to-text conversion as stream."""
30- client = AsyncElevenLabs ()
31-
32- audio_file = open (DEFAULT_VOICE_FILE , "rb" )
33-
34- stream = client .speech_to_text .convert_as_stream (
35- file = audio_file ,
36- model_id = "scribe_v1"
37- )
38-
39- transcription_text = ""
40- async for chunk in stream :
41- assert isinstance (chunk .text , str )
42- transcription_text += chunk .text
43-
44- assert len (transcription_text ) > 0
You can’t perform that action at this time.
0 commit comments