Skip to content

Commit 5532f6a

Browse files
authored
fixes speech sample bug (GoogleCloudPlatform#350)
1 parent 0e703eb commit 5532f6a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

speech/api/src/TranscribeCommand.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ protected function configure()
7777
->addOption(
7878
'stream',
7979
null,
80-
InputOption::VALUE_OPTIONAL,
81-
'Stream the audio file. Supply an argument to stream from a mic.'
80+
InputOption::VALUE_NONE,
81+
'Stream the audio file.'
8282
)
8383
;
8484
}
@@ -109,8 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
109109
} else {
110110
if ($input->getOption('async')) {
111111
transcribe_async($audioFile, $languageCode, $options);
112-
}
113-
if ($input->getOption('stream')) {
112+
} elseif ($input->getOption('stream')) {
114113
$encodingInt = constant("google\cloud\speech\\v1\RecognitionConfig\AudioEncoding::$encoding");
115114
streaming_recognize($audioFile, $languageCode, $encodingInt, $sampleRate);
116115
} else {

0 commit comments

Comments
 (0)