Skip to content

Commit 0e703eb

Browse files
danaharonbshaffer
authored andcommitted
Update README.md (GoogleCloudPlatform#348)
1 parent a63a93e commit 0e703eb

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

speech/api/README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,23 @@ Configure your project using [Application Default Credentials][adc]
2020

2121
$ export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json
2222

23-
## Audio Format
24-
25-
For the best results, use [SoX][sox] to format audio files into raw format:
26-
27-
```sh
28-
sox YourAudio.mp3 --rate 16k -encoding signed -bits 8 YourAudio.raw
29-
```
30-
31-
See [Choosing an Audio Encoding][choose-encoding] for more information.
32-
3323
## Usage
3424

3525
Once you have a speech sample in the proper format, send it through the speech
3626
API using the transcribe command:
3727

3828
```sh
39-
php speech.php transcribe YourAudio.raw --encoding LINEAR16 --sample-rate 16000
29+
php speech.php transcribe test/data/audio32KHz.raw --encoding LINEAR16 --sample-rate 32000
30+
php speech.php transcribe test/data/audio32KHz.flac --encoding FLAC --sample-rate 32000 --async
31+
4032
```
33+
## Troubleshooting
34+
35+
If you have not set a timezone you may get an error from php. This can be resolved by:
36+
a) Finding where the php.ini is stored by running php -i | grep 'Configuration File'
37+
b) Finding out your timezone from the list on this page: http://php.net/manual/en/timezones.php
38+
c) Editing the php.ini file (or creating one if it doesn't exist)
39+
d) Adding the timezone to the php.ini file e.g., adding the following line: date.timezone = "America/Los_Angeles"
4140

4241
[speech-api]: http://cloud.google.com/speech
4342
[google-cloud-php]: https://googlecloudplatform.github.io/google-cloud-php/

0 commit comments

Comments
 (0)