type: com.google.api.codegen.samplegen.v1p2.SampleConfigProto
schema_version: 1.2.0
samples:
- region_tag: speech_transcribe_enhanced_model
  title: Using Enhanced Models (Local File)
  description: Transcribe a short audio file using an enhanced model
  rpc: Recognize
  service: google.cloud.speech.v1.Speech
  request:
  - field: audio.content
    value: "resources/hello.wav"
    input_parameter: local_file_path
    comment: Path to local audio file, e.g. /path/audio.wav
    value_is_file: true
  - field: config.model
    value: "phone_call"
    comment: |
      The enhanced model to use, e.g. phone_call
  - field: config.use_enhanced
    value: true
    comment: |
      Use an enhanced model for speech recognition (when set to true).
      Project must be eligible for requesting enhanced models.
      Enhanced speech models require that you opt-in to data logging.
  - field: config.language_code
    value: "en-US"
    comment: The language of the supplied audio
  response:
  - loop:
      variable: result
      collection: $resp.results
      body:
      - comment:
        - First alternative is the most probable result
      - define: alternative = result.alternatives[0]
      - print:
        - "Transcript: %s"
        - alternative.transcript
