title: How can a bot receive a voice file from Facebook Messenger (MP4) and convert it to a format that is recognized by speech engines like Bing or Google?
body: <p>I'm trying to make a bot for Facebook Messenger using Microsoft's Bot Framework that will do this: </p>
  
  <ul>
  <li>Get a user's voice message sent via Facebook Messenger</li>
  <li>Convert speech to text</li>
  <li>Do something with it</li>
  </ul>
  
  <p>There's no problem with getting the voice message from Messenger (the URL can be extracted from the message the bot receives), and there's also no problem with converting an audio file to speech (using Bing Speech API or Google's similar API). </p>
  
  <p>However, these APIs require PCM (WAV) files, while Facebook Messenger gives you an MP4 file. </p>
  
  <p>Is there a popular/standard way of converting one format into another that is used in writing the bots? </p>
  
  <p>So far my best idea is to run <code>vlc.exe</code> as a console job on my server and convert the file, but that doesn't sound like the best solution. </p>