code: def tts_cli(text, file, output, slow, lang, nocheck):
      
  
      # stdin for <text>
      if text == '-':
          text = click.get_text_stream('stdin').read()
  
      # stdout (when no <output>)
      if not output:
          output = click.get_binary_stream('stdout')
  
      # <file> input (stdin on '-' is handled by click.File)
      if file:
          try:
              text = file.read()
          except UnicodeDecodeError as e:  # pragma: no cover
              log.debug(str(e), exc_info=True)
              raise click.FileError(
                  file.name,
                  "<file> must be encoded using '%s'." %
                  sys_encoding())
  
      # TTS
      try:
          tts = gTTS(
              text=text,
              lang=lang,
              slow=slow,
              lang_check=not nocheck)
          tts.write_to_fp(output)
      except (ValueError, AssertionError) as e:
          raise click.UsageError(str(e))
      except gTTSError as e:
          raise click.ClickException(str(e))
docs: Read <text> to mp3 format using Google Translate's Text-to-Speech API
      (set <text> or --file <file> to - for standard input)