Skip to content

Instantly share code, notes, and snippets.

@lineker
Forked from alotaiba/google_speech2text.md
Last active December 21, 2015 02:49
Show Gist options
  • Save lineker/6237597 to your computer and use it in GitHub Desktop.
Save lineker/6237597 to your computer and use it in GitHub Desktop.

Revisions

  1. lineker revised this gist Aug 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion google_speech2text.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ Maximum results to return for utterance

    ## POST
    `body`
    Should contain FLAC formatted voice binary
    Should contain FLAC formatted voice binary (max length 15 seconds)

    ## HTTP Header
    `Content-Type`
  2. @alotaiba alotaiba revised this gist Feb 8, 2012. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions google_speech2text.md
    Original file line number Diff line number Diff line change
    @@ -29,16 +29,16 @@ These examples assume you have a voice file encoded in FLAC called `alsalam-alik
    ### wget
    This will save JSON response in a file called `recognized.json`

    $ wget --post-file='alsalam-alikum.flac' \
    $ --user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7' \
    $ --header='Content-Type: audio/x-flac; rate=16000;' \
    $ -O 'recognized.json' \
    $ 'https://www.google.com/speech-api/v1/recognize?client=chromium&lang=ar-QA&maxresults=10'
    wget --post-file='alsalam-alikum.flac' \
    --user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7' \
    --header='Content-Type: audio/x-flac; rate=16000;' \
    -O 'recognized.json' \
    'https://www.google.com/speech-api/v1/recognize?client=chromium&lang=ar-QA&maxresults=10'

    ### curl

    $ curl -X POST \
    $ --data-binary @alsalam-alikum.flac \
    $ --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7' \
    $ --header 'Content-Type: audio/x-flac; rate=16000;' \
    $ 'https://www.google.com/speech-api/v1/recognize?client=chromium&lang=ar-QA&maxresults=10'
    curl -X POST \
    --data-binary @alsalam-alikum.flac \
    --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7' \
    --header 'Content-Type: audio/x-flac; rate=16000;' \
    'https://www.google.com/speech-api/v1/recognize?client=chromium&lang=ar-QA&maxresults=10'
  3. @alotaiba alotaiba revised this gist Feb 8, 2012. 1 changed file with 11 additions and 11 deletions.
    22 changes: 11 additions & 11 deletions google_speech2text.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Google Speech To Text API
    Base URL: https://www.google.com/speech-api/v1/recognize
    It accepts `POST` requests with voice file encoded in FLAC, and query parameters for control.
    It accepts `POST` requests with voice file encoded in FLAC format, and query parameters for control.

    ## Query Parameters
    `client`
    @@ -29,16 +29,16 @@ These examples assume you have a voice file encoded in FLAC called `alsalam-alik
    ### wget
    This will save JSON response in a file called `recognized.json`

    wget --post-file='alsalam-alikum.flac' \
    --user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7' \
    --header='Content-Type: audio/x-flac; rate=16000;' \
    -O 'recognized.json' \
    'https://www.google.com/speech-api/v1/recognize?client=chromium&lang=ar-QA&maxresults=10'
    $ wget --post-file='alsalam-alikum.flac' \
    $ --user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7' \
    $ --header='Content-Type: audio/x-flac; rate=16000;' \
    $ -O 'recognized.json' \
    $ 'https://www.google.com/speech-api/v1/recognize?client=chromium&lang=ar-QA&maxresults=10'

    ### curl

    curl -X POST \
    --data-binary @alsalam-alikum.flac \
    --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7' \
    --header 'Content-Type: audio/x-flac; rate=16000;' \
    'https://www.google.com/speech-api/v1/recognize?client=chromium&lang=ar-QA&maxresults=10'
    $ curl -X POST \
    $ --data-binary @alsalam-alikum.flac \
    $ --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7' \
    $ --header 'Content-Type: audio/x-flac; rate=16000;' \
    $ 'https://www.google.com/speech-api/v1/recognize?client=chromium&lang=ar-QA&maxresults=10'
  4. @alotaiba alotaiba revised this gist Feb 3, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion google_speech2text.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Google Speech To Text API
    Base URL: https://www.google.com/speech-api/v1/recognize
    It accepts `POST` requests with voice file encoded in FLAC, with query parameters for control.
    It accepts `POST` requests with voice file encoded in FLAC, and query parameters for control.

    ## Query Parameters
    `client`
  5. @alotaiba alotaiba revised this gist Feb 3, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion google_speech2text.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Google Speech To Text API
    Base URL: https://www.google.com/speech-api/v1/recognize
    It accepts POST requests with voice file encoded in FLAC, with query parameters for control.
    It accepts `POST` requests with voice file encoded in FLAC, with query parameters for control.

    ## Query Parameters
    `client`
  6. @alotaiba alotaiba revised this gist Feb 3, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion google_speech2text.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Google Speech To Text API
    Base URL: https://www.google.com/speech-api/v1/recognize
    Base URL: https://www.google.com/speech-api/v1/recognize
    It accepts POST requests with voice file encoded in FLAC, with query parameters for control.

    ## Query Parameters
  7. @alotaiba alotaiba revised this gist Feb 3, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion google_speech2text.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ Speech language, for example, `ar-QA` for Qatari Arabic, or `en-US` for U.S. Eng
    Maximum results to return for utterance

    ## POST
    `body`
    `body`
    Should contain FLAC formatted voice binary

    ## HTTP Header
  8. @alotaiba alotaiba revised this gist Feb 3, 2012. 1 changed file with 6 additions and 3 deletions.
    9 changes: 6 additions & 3 deletions google_speech2text.md
    Original file line number Diff line number Diff line change
    @@ -13,12 +13,15 @@ Speech language, for example, `ar-QA` for Qatari Arabic, or `en-US` for U.S. Eng
    Maximum results to return for utterance

    ## POST
    Body (Content)
    `body`
    Should contain FLAC formatted voice binary

    ## HTTP Header
    `Content-Type` should be `audio/x-flac; rate=16000;` where MIME and sample rate of the FLAC file is included
    `User-Agent` can be the client's user agent string, for spoofing purposes, we'll use Chrome's
    `Content-Type`
    Should be `audio/x-flac; rate=16000;`, where MIME and sample rate of the FLAC file is included

    `User-Agent`
    Can be the client's user agent string, for spoofing purposes, we'll use Chrome's

    ## Examples
    These examples assume you have a voice file encoded in FLAC called `alsalam-alikum.flac`.
  9. @alotaiba alotaiba revised this gist Feb 3, 2012. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions google_speech2text.md
    Original file line number Diff line number Diff line change
    @@ -3,15 +3,17 @@ Base URL: https://www.google.com/speech-api/v1/recognize
    It accepts POST requests with voice file encoded in FLAC, with query parameters for control.

    ## Query Parameters
    **`client`**
    `client`
    The client's name you're connecting from. For spoofing purposes, let's use `chromium`
    **`lang`**

    `lang`
    Speech language, for example, `ar-QA` for Qatari Arabic, or `en-US` for U.S. English
    **`maxresults`**

    `maxresults`
    Maximum results to return for utterance

    ## POST
    **Body (Content)**
    Body (Content)
    Should contain FLAC formatted voice binary

    ## HTTP Header
  10. @alotaiba alotaiba created this gist Feb 3, 2012.
    39 changes: 39 additions & 0 deletions google_speech2text.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    # Google Speech To Text API
    Base URL: https://www.google.com/speech-api/v1/recognize
    It accepts POST requests with voice file encoded in FLAC, with query parameters for control.

    ## Query Parameters
    **`client`**
    The client's name you're connecting from. For spoofing purposes, let's use `chromium`
    **`lang`**
    Speech language, for example, `ar-QA` for Qatari Arabic, or `en-US` for U.S. English
    **`maxresults`**
    Maximum results to return for utterance

    ## POST
    **Body (Content)**
    Should contain FLAC formatted voice binary

    ## HTTP Header
    `Content-Type` should be `audio/x-flac; rate=16000;` where MIME and sample rate of the FLAC file is included
    `User-Agent` can be the client's user agent string, for spoofing purposes, we'll use Chrome's

    ## Examples
    These examples assume you have a voice file encoded in FLAC called `alsalam-alikum.flac`.

    ### wget
    This will save JSON response in a file called `recognized.json`

    wget --post-file='alsalam-alikum.flac' \
    --user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7' \
    --header='Content-Type: audio/x-flac; rate=16000;' \
    -O 'recognized.json' \
    'https://www.google.com/speech-api/v1/recognize?client=chromium&lang=ar-QA&maxresults=10'

    ### curl

    curl -X POST \
    --data-binary @alsalam-alikum.flac \
    --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7' \
    --header 'Content-Type: audio/x-flac; rate=16000;' \
    'https://www.google.com/speech-api/v1/recognize?client=chromium&lang=ar-QA&maxresults=10'