语音增益SpeechtoText Python SDK
voicegain-speech的Python项目详细描述
Voicegain语音到文本Python SDK
用于VoicegainSpeech-to-Text API的Python SDK。在
这个API允许大词汇量的语音到文本的转录以及基于语法的语音识别。同时支持实时和离线用例。在
您可以看到核心的Voicegain API文档here。在
此SDK包含的API的完整文档可用here-此链接需要Voicegain门户上的帐户-请参阅下面的注册方法。在
要求
要使用此API,您需要使用Voicegain帐户。您可以通过在Voicegain Portal上注册来创建帐户。注册无需信用卡。在
你可以看到定价here-基本上,离线每分钟1美分,实时每分钟1.25美分。每月有600分钟的免费续费。在
安装
直接从PyPI开始:
pip install voicegain-speech
示例
- sync_转录示例:
配置:
^{pr2}$转录本地文件:
transcribe_api=TranscribeApi(api_client)file_path="Your local file path"withopen(file_path,"rb")asf:audio_base64=base64.b64encode(f.read()).decode()response=transcribe_api.asr_transcribe_post(sync_transcription_request={"audio":{"source":{"inline":{"data":audio_base64}}}})alternatives=response.result.alternativesifalternatives:local_result=alternatives[0].utteranceprint("result from file: ",local_result)else:local_result=Noneprint("no transcription")
更多示例可以在我们的GitHub上的examples文件夹中找到
有关Voicegain平台的更多信息,请访问www.voicegain.ai
- 项目
标签: