File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
zhipuai/api_resource/audio Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ def test_audio_speech_streaming(logging_conf):
3838 input = '你好呀,欢迎来到智谱开放平台' ,
3939 voice = 'tongtong' ,
4040 stream = True ,
41- response_format = 'wav' ,
41+ response_format = 'mp3' ,
42+ encode_format = 'hex'
4243 )
4344 with open ("output.pcm" , "wb" ) as f :
4445 for item in response :
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ def speech(
5151 extra_headers : Headers | None = None ,
5252 extra_body : Body | None = None ,
5353 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
54+ encode_format : str ,
5455 ) -> _legacy_response .HttpxBinaryResponseContent | StreamResponse [AudioSpeechChunk ]:
5556 body = deepcopy_minimal (
5657 {
@@ -61,7 +62,8 @@ def speech(
6162 "response_format" : response_format ,
6263 "sensitive_word_check" : sensitive_word_check ,
6364 "request_id" : request_id ,
64- "user_id" : user_id
65+ "user_id" : user_id ,
66+ "encode_format" : encode_format
6567 }
6668 )
6769 return self ._post (
You can’t perform that action at this time.
0 commit comments