Giter VIP home page Giter VIP logo

voicetools's Introduction

voicetools

voicetools: 语音识别和语音合成的基础包。

简介

以百度语音 API 为基础的语音识别和语音合成的基础包,同时集成了 wolfram API 和图灵机器人 API。附带树莓派语音助手示例代码。

用法

安装

pip install voicetools

语音识别及语音合成

from voicetools import BaiduVoice
# api key 及 secret key 请在百度语音官方网站注册获取
token = BaiduVoice.get_baidu_token('YOUR_VOICE_API_KEY', 'YOUR_VOICE_SECRET')
bv = BaiduVoice(token)
# 语音识别
results = bv.asr('path/to/your/audio/file')  # 返回识别结果列表,可选参数见百度语音文档
# 语音合成
audio = bv.tts('你好')  # 返回 MP3 格式二进制数据,可选参数见百度语音文档

wolfram API

wolfram 是一个功能强大的搜索引擎,可以直接返回问题的答案,而不是返回页面。 由于国内网络原因,接口稳定性差,且只支持英文搜索。

from voicetools import Wolfram
# api key 请在 wolfram 网站注册获取
robot = Wolfram('YOUR_WOLFRAM_KEY')
result = robot.ask_wolfram('Who is Bill Gates?')  # 返回文字信息

图灵机器人 API

国产 AI 的 API。

from voicetools import TuringRobot
# api key 请在图灵机器人网站注册获取
robot = TuringRobot('YOUR_TURING_KEY')
result = robot.ask_turing('给我讲个笑话')  # 返回文字信息

依赖

  • requests
  • wolframalpha

树莓派语音助手示例程序

请点击这里

voicetools's People

Contributors

namco1992 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.