Speech CLI speech to text output format, and using MP3 as input format

Paul Nerie 266 Reputation points
2020-07-09T10:06:44.84+00:00

I'm trying out this Cognitive Service speech-to-text CLI:

https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/quickstarts/speech-to-text-from-file?tabs=linux%2Cbrowser%2Cwindowsinstall&pivots=programmer-tool-spx

I can generate an output file, but the transcript is just one very long line.

Is there a way to have some line breaks somehow? Maybe when the service detects a pause, it inserts a line break?

Also when I try to use an MP3 file (using --format mp3), I get this error: ERROR: Exception with an error code: 0x29 (SPXERR_GSTREAMER_NOT_FOUND_ERROR) Do I need to install anything else for MP3 to work?

Thank you very much.

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,336 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,300 questions
0 comments No comments
{count} vote

Accepted answer
  1. GiftA-MSFT 11,146 Reputation points
    2020-07-10T23:28:32.59+00:00

    Hi, thanks for the updates. In response to your first question, we current don't have paragraph level support. However, you can easily separate the output text based on sentence ending with period and timestamp to decide the pause between two sentences before breaking them into paragraphs. I have provided this feedback internally to the product team but feel free to share this request on uservoice forum so you and others can up-vote to enable product team prioritize this feature. Thanks.


2 additional answers

Sort by: Most helpful
  1. Paul Nerie 266 Reputation points
    2020-07-10T02:47:32.433+00:00

    For anyone who stumbles upon this and have the same question about the error I posted above, there actually is a documentation for it:

    https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/how-to-use-codec-compressed-audio-input-streams?tabs=debian&pivots=programming-language-csharp


  2. Rob Chambers [msft] 1 Reputation point Microsoft Employee
    2020-07-13T15:11:37.447+00:00

    Using the Speech CLI (spx), you can output different types of files, that will have the text "chunked" in different ways...

    • By default, spx will output "all" recognized events, concatenated, in a file like "output.*.tsv"
    • Using --output each command line options, it will also produce a file with "each" recognized event, thus, the text will be in chunks
    • Uy using --output batch json command line option, it will also/or instead produce a file with "all" recognized text concatenated

    See spx help recognize output for more details on each of the three options.

    Thus, for your specific question, you can do this: spx recognize --file example.wav --output each recognized text --output each file output.tsv --output each tsv file has header false