class_docstr: TODO: Add voice conversion and Capacitron support.
docstr: Convert text to speech.
  
  Args:
      text (str):
          Input text to synthesize.
      speaker (str, optional):
          Speaker name for multi-speaker. You can check whether loaded model is multi-speaker by
          `tts.is_multi_speaker` and list speakers by `tts.speakers`. Defaults to None.
      language (str, optional):
          Language code for multi-lingual models. You can check whether loaded model is multi-lingual
          `tts.is_multi_lingual` and list available languages by `tts.languages`. Defaults to None.
      speaker_wav (str, optional):
          Path to a reference wav file to use for voice cloning with supporting models like YourTTS.
          Defaults to None.
      emotion (str, optional):
          Emotion to use for 🐸Coqui Studio models. Defaults to "Neutral".
      speed (float, optional):
          Speed factor to use for 🐸Coqui Studio models, between 0.0 and 2.0. Defaults to None.
      pipe_out (BytesIO, optional):
          Flag to stdout the generated TTS wav file for shell pipe.
      file_path (str, optional):
          Output file path. Defaults to "output.wav".
      split_sentences (bool, optional):
          Split text into sentences, synthesize them separately and concatenate the file audio.
          Setting it False uses more VRAM and possibly hit model specific text length or VRAM limits. Only
          applicable to the 🐸TTS models. Defaults to True.
      kwargs (dict, optional):
          Additional arguments for the model.
docstr_tok: ["Convert","text","to","speech",".","Args",":","text","(","str",")",":","Input","text","to","synthesize",".","speaker","(","str",",","optional",")",":","Speaker","name","for","multi-speaker",".","You","can","check","whether","loaded","model","is","multi-speaker","by","`","tts.is_multi_speaker","`","and","list","speakers","by","`","tts.speakers","`",".","Defaults","to","None",".","language","(","str",",","optional",")",":","Language","code","for","multi-lingual","models",".","You","can","check","whether","loaded","model","is","multi-lingual","`","tts.is_multi_lingual","`","and","list","available","languages","by","`","tts.languages","`",".","Defaults","to","None",".","speaker_wav","(","str",",","optional",")",":","Path","to","a","reference","wav","file","to","use","for","voice","cloning","with","supporting","models","like","YourTTS",".","Defaults","to","None",".","emotion","(","str",",","optional",")",":","Emotion","to","use","for","\ud83d\udc38Coqui","Studio","models",".","Defaults","to","``","Neutral","''",".","speed","(","float",",","optional",")",":","Speed","factor","to","use","for","\ud83d\udc38Coqui","Studio","models",",","between","0.0","and","2.0",".","Defaults","to","None",".","pipe_out","(","BytesIO",",","optional",")",":","Flag","to","stdout","the","generated","TTS","wav","file","for","shell","pipe",".","file_path","(","str",",","optional",")",":","Output","file","path",".","Defaults","to","``","output.wav","''",".","split_sentences","(","bool",",","optional",")",":","Split","text","into","sentences",",","synthesize","them","separately","and","concatenate","the","file","audio",".","Setting","it","False","uses","more","VRAM","and","possibly","hit","model","specific","text","length","or","VRAM","limits",".","Only","applicable","to","the","\ud83d\udc38TTS","models",".","Defaults","to","True",".","kwargs","(","dict",",","optional",")",":","Additional","arguments","for","the","model","."]
code: def tts_to_file(
      self,
      text: str,
      speaker: str = None,
      language: str = None,
      speaker_wav: str = None,
      emotion: str = None,
      speed: float = 1.0,
      pipe_out=None,
      file_path: str = "output.wav",
      split_sentences: bool = True,
      **kwargs,
  ):
      """Convert text to speech.
  
      Args:
          text (str):
              Input text to synthesize.
          speaker (str, optional):
              Speaker name for multi-speaker. You can check whether loaded model is multi-speaker by
              `tts.is_multi_speaker` and list speakers by `tts.speakers`. Defaults to None.
          language (str, optional):
              Language code for multi-lingual models. You can check whether loaded model is multi-lingual
              `tts.is_multi_lingual` and list available languages by `tts.languages`. Defaults to None.
          speaker_wav (str, optional):
              Path to a reference wav file to use for voice cloning with supporting models like YourTTS.
              Defaults to None.
          emotion (str, optional):
              Emotion to use for 🐸Coqui Studio models. Defaults to "Neutral".
          speed (float, optional):
              Speed factor to use for 🐸Coqui Studio models, between 0.0 and 2.0. Defaults to None.
          pipe_out (BytesIO, optional):
              Flag to stdout the generated TTS wav file for shell pipe.
          file_path (str, optional):
              Output file path. Defaults to "output.wav".
          split_sentences (bool, optional):
              Split text into sentences, synthesize them separately and concatenate the file audio.
              Setting it False uses more VRAM and possibly hit model specific text length or VRAM limits. Only
              applicable to the 🐸TTS models. Defaults to True.
          kwargs (dict, optional):
              Additional arguments for the model.
      """
      self._check_arguments(
          speaker=speaker,
          language=language,
          speaker_wav=speaker_wav,
          **kwargs,
      )
  
      wav = self.tts(
          text=text,
          speaker=speaker,
          language=language,
          speaker_wav=speaker_wav,
          split_sentences=split_sentences,
          **kwargs,
      )
      self.synthesizer.save_wav(
          wav=wav, path=file_path, pipe_out=pipe_out
      )
      return file_path
  
imports: import tempfile
  import warnings
  from pathlib import Path
  from typing import Union
  import numpy
  from torch import nn
  from TTS.utils.audio.numpy_transforms import save_wav
  from TTS.utils.manage import ModelManager
  from TTS.utils.synthesizer import Synthesizer
  from TTS.config import load_config
label_desc: Use image node_id 16 for calling the TTS obj's underlying member method code with example usage: obj.tts_to_file(text, speaker, language, speaker_wav, emotion, speed, pipe_out, file_path, split_sentences) and returns: file_path