We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56e90d3 commit abfc636Copy full SHA for abfc636
speech/quickstart.php
@@ -26,19 +26,16 @@
26
use Google\Cloud\Speech\V1\RecognitionConfig\AudioEncoding;
27
28
# The name of the audio file to transcribe
29
-$audioFile = __DIR__ . '/test/data/audio32KHz.raw';
30
-
31
-# get contents of a file into a string
32
-$content = file_get_contents($audioFile);
+$gcsURI = "gs://cloud-samples-data/speech/brooklyn_bridge.raw";
33
34
# set string as audio content
35
$audio = (new RecognitionAudio())
36
- ->setContent($content);
+ ->setUri($gcsURI);
37
38
# The audio file's encoding, sample rate and language
39
$config = new RecognitionConfig([
40
'encoding' => AudioEncoding::LINEAR16,
41
- 'sample_rate_hertz' => 32000,
+ 'sample_rate_hertz' => 16000,
42
'language_code' => 'en-US'
43
]);
44
0 commit comments