Batch text to speech error

EDS 26 Reputation points

Hello, i'm trying to use Batch text to speech following this instructions :
But when I try these commands :
spx synthesize --foreach in @C:\speech\test.tsv --voice fr-FR-BrigitteNeural
spx synthesize --foreach in @C:\speech\test.tsv

I get this error :
SPX - Azure Speech CLI, Version 1.24.1
Copyright (c) 2022 Microsoft Corporation. All Rights Reserved.

  service.config.key= d408****************************  
  ERROR: Object reference not set to an instance of an object.  

These simple commands are working well :

spx synthesize --text "Testing synthesis using the Speech CLI" --speakers  
spx synthesize --text "Bienvenue chez moi." --voice fr-FR-BrigitteNeural --speakers  

C:\speech\test.tsv looks like this :

audio.output text
C:\speech\Output\0.wav Test 1
C:\speech\Output\1.wav Test 2

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,469 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ramr-msft 17,626 Reputation points

    @EDS Thanks for the question. make sure that your file contains a tab rather than spaces between the file location and the text. Here is the sample test.csv that you can try.

    audio. Output text
    C:\speech\Output\0.wav Test 1
    C:\speech\Output\1.wav Test 2

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. EDS 26 Reputation points

    It fails too when i use the Microsoft sample TSV file (just changed path).

    audio.output text
    C:\speech\Output\wav_1.wav Sample text to synthesize.
    C:\speech\Output\wav_2.wav Using the Speech CLI to run batch-synthesis.
    C:\speech\Output\wav_3.wav Some more text to test capabilities.

    Here is the exception.133120138775965417.2600.133120138776623192.spx.error.log :

    System.NullReferenceException: Object reference not set to an instance of an object.
    at Azure.AI.Details.Common.CLI.SynthesizeCommand.CheckSynthesizerInput() in D:\a_work\1\s\clis\source\cli\spx\commands\synthesize_command.cs:line 395
    at Azure.AI.Details.Common.CLI.SynthesizeCommand.StartCommand() in D:\a_work\1\s\clis\source\cli\spx\commands\synthesize_command.cs:line 544
    at Azure.AI.Details.Common.CLI.SynthesizeCommand.Synthesize() in D:\a_work\1\s\clis\source\cli\spx\commands\synthesize_command.cs:line 68
    at Azure.AI.Details.Common.CLI.SynthesizeCommand.RunCommand() in D:\a_work\1\s\clis\source\cli\spx\commands\synthesize_command.cs:line 34
    at Azure.AI.Details.Common.CLI.Program.DispatchRunCommand(ICommandValues values) in D:\a_work\1\s\clis\source\cli\spx\Program_SPX.cs:line 69
    at Azure.AI.Details.Common.CLI.Command.RunCommandsInProc(Queue1 queue) in D:\a\_work\1\s\clis\source\cli\common\details\commands\command.cs:line 586 at Azure.AI.Details.Common.CLI.Command.<>c__DisplayClass20_0.<CheckExpectedRunInProcAsync>b__0() in D:\a\_work\1\s\clis\source\cli\common\details\commands\command.cs:line 568 at Azure.AI.Details.Common.CLI.Command.CheckExpectedOutputAsync(ICommandValues values, Queue1 queue, Func1 func) in D:\a\_work\1\s\clis\source\cli\common\details\commands\command.cs:line 552 at Azure.AI.Details.Common.CLI.Command.CheckExpectedRunInProcAsync(ICommandValues values, Queue1 queue) in D:\a_work\1\s\clis\source\cli\common\details\commands\command.cs:line 568

    I don't know what the D:\ refers to, I don't have a D: drive on my PC. The error seems to concern "foreach" because this last command works well:

    spx synthesize --text "Exemple de texte" --audio output C:\speech\output\wav_1.wav  --voice fr-FR-BrigitteNeural  
    0 comments No comments