Speech CLI 출력 옵션 구성

Speech CLI 출력은 표준 출력 또는 지정된 파일에 쓸 수 있습니다.

상황에 맞는 Speech CLI 도움말을 보려면 다음 명령 중 하나를 실행할 수 있습니다.

spx help recognize output examples
spx help synthesize output examples
spx help translate output examples
spx help intent output examples

표준 출력

파일 인수가 하이픈(-)이면 다음 예제와 같이 결과를 표준 출력에 씁니다.

spx recognize --file caption.this.mp4 --format any --output vtt file - --output srt file - --output each file - @output.each.detailed --property SpeechServiceResponse_StablePartialResultThreshold=0 --profanity masked

기본 파일 출력

file 옵션을 생략하면 출력을 현재 디렉터리의 기본 파일에 씁니다.

예를 들어 다음 명령을 실행하여 WebVTT 및 SRT 캡션을 자체 기본 파일에 씁니다.

spx recognize --file caption.this.mp4 --format any --output vtt --output srt --output each text --output all duration

기본 파일 이름은 다음과 같습니다. 여기서 <EPOCH_TIME>은 런타임에 바뀝니다.

  • 기본 SRT 파일 이름에는 입력 파일 이름 및 로컬 운영 체제 Epoch 시간(output.caption.this.<EPOCH_TIME>.srt)이 포함됩니다.
  • 기본 웹 VTT 파일 이름에는 입력 파일 이름 및 로컬 운영 체제 Epoch 시간(output.caption.this.<EPOCH_TIME>.vtt)이 포함됩니다.
  • 기본 output each 파일 이름(each.<EPOCH_TIME>.tsv)에는 로컬 운영 체제 Epoch 시간이 포함됩니다. 옵션을 지정 --output each 하지 않는 한 이 파일은 기본적으로 만들어지지 않습니다.
  • 기본 output all 파일 이름(output.<EPOCH_TIME>.tsv)에는 로컬 운영 체제 Epoch 시간이 포함됩니다. 이 파일은 기본적으로 만들어집니다.

특정 파일에 출력

기본 파일 대신 지정한 파일에 출력하려면 file 옵션을 파일 이름으로 설정합니다.

예를 들어 WebVTT 밑 SRT 캡션을 모두 지정한 파일에 출력하려면 다음 명령을 실행합니다.

spx recognize --file caption.this.mp4 --format any --output vtt file caption.vtt --output srt file caption.srt --output each text --output each file each.result.tsv --output all file output.result.tsv

앞의 명령은 eachall 결과도 지정된 파일에 출력합니다.

여러 파일에 출력

spx translate를 사용하는 번역의 경우 원본 언어(예: --source en-US) 및 각 대상 언어(예: --target "de;fr;zh-Hant")에 대해 별도의 파일이 만들어집니다.

예를 들어 번역된 SRT 및 WebVTT 캡션을 출력하려면 다음 명령을 실행합니다.

spx translate --source en-US --target "de;fr;zh-Hant" --file caption.this.mp4 --format any --output vtt file caption.vtt --output srt file caption.srt

캡션은 caption.srt, caption.vtt, caption.de.srt, caption.de.vtt, caption.fr.srt, caption.fr.vtt, caption.zh-Hant.srtcaption.zh-Hant.vtt 파일에 씁니다.

머리글 표시 안 함

has header false 옵션을 설정하여 출력 파일에서 머리글 줄을 표시하지 않을 수 있습니다.

spx recognize --nodefaults @my.defaults --file audio.wav --output recognized text --output file has header false

--nodefaults에 대한 자세한 내용은 Speech CLI 데이터 저장소 구성을 참조하세요.

다음 단계