title: Swift: How to Convert Text-to-Speech Generated Audio to .mp3?
body: <p>I have converted text to speech using the <code>AVSpeechSynthesizer</code>. When clicked on Play, converted speech plays. I don't know the extension of this audio file.<br> My goal is to convert this created audio file to .mp3. I have searched in Google but I didn't find anything. Any help is appreciated. </p>
  
  <p>My code is here: Convert text to speech </p>
  
  <pre><code>text = UserDefaults.standard.string(forKey: "TextString")!
  voice = selectCountryDic["Clanguage"]!
  let speechText = AVSpeechUtterance(string:text)
  speechText.voice = AVSpeechSynthesisVoice(language:voice)
  
  let synthesizer = AVSpeechSynthesizer()
  synthesizer.speak(speechText)
  </code></pre>