您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

什么是语音 CLI?What is the Speech CLI?

语音 CLI 是一种命令行工具,用于在不编写任何代码的情况下使用语音服务。The Speech CLI is a command line tool for using the Speech service without writing any code. 语音 CLI 只需要很少的设置,并且很容易立即开始体验语音服务的关键功能,以确定是否可以满足你的用例。The Speech CLI requires minimal setup, and it's easy to immediately start experimenting with key features of the Speech service to see if your use-cases can be met. 在几分钟内即可运行简单的测试工作流,如对一系列文件中的语音进行批量语音识别,或对文件中的字符串集合进行文本转语音操作。Within minutes, you can run simple test workflows like batch speech-recognition from a directory of files, or text-to-speech on a collection of strings from a file. 除了简单的工作流,语音 CLI 还可随时投入生产,并且可以使用自动化 .bat 或 shell 脚本进行纵向扩展,以运行更大的进程。Beyond simple workflows, the Speech CLI is production-ready and can be scaled up to run larger processes using automated .bat or shell scripts.

语音 SDK 中的大部分主要功能都可在语音 CLI 中使用,一些高级功能和自定义内容在语音 CLI 中进行了简化。The majority of the primary features in the Speech SDK are available in the Speech CLI, and some advanced features and customizations are simplified in the Speech CLI. 请参考以下指南,确定何时使用语音 CLI 或语音 SDK。Consider the following guidance to decide when to use the Speech CLI or the Speech SDK.

适合使用语音 CLI 的情况:Use the Speech CLI when:

  • 想在极少设置且无需代码的情况下试验语音服务功能You want to experiment with Speech service features with minimal setup and no code
  • 对使用语音服务的生产应用程序的要求相对简单You have relatively simple requirements for a production application using the Speech service

适合使用语音 SDK 的情况:Use the Speech SDK when:

  • 想在特定语言或平台(如 C#、Python、C++)中集成语音服务功能You want to integrate Speech service functionality within a specific language or platform (e.g. C#, Python, C++)
  • 需要满足复杂的要求,可能需要高级服务请求,或者开发自定义行为(包括响应流式处理)You have complex requirements that may require advanced service requests, or developing custom behavior including response streaming

核心功能Core features

  • 语音识别 - 将音频文件中的或直接将麦克风语音转换为文本,或转录录制的对话。Speech recognition - Convert speech-to-text either from audio files or directly from a microphone, or transcribe a recorded conversation.

  • 语音合成 - 将文本文件中输入的文本或直接来自于命令行的输入文本转换为语音。Speech synthesis - Convert text-to-speech using either input from text files, or input directly from the command line. 使用 SSML 配置标准语音或神经语音来自定义语音输出特征。Customize speech output characteristics using SSML configurations, and either standard or neural voices.

  • 语音翻译 - 将源语言的音频翻译为目标语言的文本或音频。Speech translation - Translate audio in a source language to text or audio in a target language.

  • 在 Azure 计算资源上运行 - 使用 spx webjob 发送语音 CLI 命令以在 Azure 远程计算资源上运行。Run on Azure compute resources - Send Speech CLI commands to run on an Azure remote compute resource using spx webjob.

入门Get started

若要开始使用语音 CLI,请参阅基础知识文章To get started with the Speech CLI, see the basics article. 本文介绍如何运行一些基本命令,并显示了用于运行批处理操作以实现语音转文本和文本转语音的一些高级命令。This article shows you how to run some basic commands, and also shows slightly more advanced commands for running batch operations for speech-to-text and text-to-speech. 阅读基础知识文章之后,你应已对此语法有了足够的了解,可以开始编写一些自定义命令或自动执行简单的语音服务操作。After reading the basics article, you should have enough of an understanding of the syntax to start writing some custom commands, or automating simple Speech service operations.

后续步骤Next steps