Skip to main content

a sdk speech for xfyun

Project description

xfyunsdkspeech

xfyunsdkspeech是讯飞开放平台语音转写相关 API的Python SDK,提供语音听写性别年龄识别语音评测语音转写歌曲识别实时语音转写语音合成等功能的客户端实现。

功能特点

  • 语音听写:通过音频信息识别成文字
  • 性别年龄识别:通过声音信息识别用户性别年龄等信息
  • 语音评测:通过智能语音技术自动对发音水平进行评价、发音错误、缺陷定位和问题分析的能力
  • 歌曲识别:检测歌曲, 识别歌曲名称
  • 语音转写:将音频转换成文本数据
  • 实时语音转写:将连续的音频流内容,实时识别返回对应的文字流内容
  • 语音合成:通过文本数据合成音频流数据

安装方法

pip install xfyunsdkspeech

依赖说明

  • xfyunsdkcore>=0.1.0: 核心SDK依赖
  • python-dotenv: 环境变量管理

快速开始

人脸检测示例

# 初始化客户端
client = RtasrClient(
    app_id=os.getenv('APP_ID'),  # 替换为你的应用ID
    api_key=os.getenv('API_KEY'),  # 替换为你的API密钥
)

file_path = "D:\\iflytek\\project\\cloudPlatform\\demo\\websdk-java-demo\\src\main\\resources\\audio\\rtasr.pcm"

f = open(file_path, 'rb')
for chunk in client.stream(f):
    logger.info(f"返回结果: {chunk}")

更多示例见demo

核心客户端

IatClient

语音听写流式接口,用于1分钟内的即时语音转文字技术,支持实时返回识别结果,达到一边上传音频一边获得识别文本的效果

IgrClient

性别年龄识别,即机器对说话者的年龄大小以及性别属性进行分析,可以通过收到的音频数据判定发音人的性别(男,女)及年龄范围(小孩,中年,老人)

IseClient

通过智能语音技术自动对发音水平进行评价、发音错误、缺陷定位和问题分析的能力接口

LFasrClient

基于深度全序列卷积神经网络,将长段音频(5小时以内)数据转换成文本数据

QbhClient

歌曲识别技术分为歌曲原声识别以及哼唱识别。歌曲原声识别通过听筒收集音乐播放信息,生成音频指纹,在曲库中识别到对应的歌曲。 哼唱识别通过用户对着话筒哼唱小段歌曲,系统自动识别并检索出所哼唱的歌曲

RtasrClient

将连续的音频流内容,实时识别返回对应的文字流内容

TTSClient

语音合成流式接口将文字信息转化为声音信息,同时提供了众多极具特色的发音人(音库)供您选择

许可证

请参见LICENSE文件

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xfyunsdkspeech-0.0.1.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xfyunsdkspeech-0.0.1-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file xfyunsdkspeech-0.0.1.tar.gz.

File metadata

  • Download URL: xfyunsdkspeech-0.0.1.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.1

File hashes

Hashes for xfyunsdkspeech-0.0.1.tar.gz
Algorithm Hash digest
SHA256 978d4e13b64e3beff1f416fcf4d1048d64322f03c3ed0ef8e213d9cc061bcecd
MD5 7d39b2e82f11afd24aa3859be2982967
BLAKE2b-256 69ad40f1364a964b8dd61e3803135384e4d7b81cd61d25c450ccf0d09512bca2

See more details on using hashes here.

File details

Details for the file xfyunsdkspeech-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: xfyunsdkspeech-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.1

File hashes

Hashes for xfyunsdkspeech-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c376952452b28eb2a1fee4192e10489a1641e6884b0249093ba679307de1f53
MD5 91fe70802125917874f469b87dc07875
BLAKE2b-256 e364f28ac1947afb052210576c9f3959a5f4d4c66c8b2997ef78fc76962c6471

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page