title: Acoustic model path not set right CMU Sphinx
body: <p>The code written below is to convert audio to text using CMU Sphinx in Java 1.6 and Eclipse Helios.   </p>
  
  <pre><code>import java.io.FileInputStream;
  import java.io.IOException;
  import java.io.FileNotFoundException;
  
  import edu.cmu.sphinx.api.Configuration;
  import edu.cmu.sphinx.api.SpeechResult;
  import edu.cmu.sphinx.api.StreamSpeechRecognizer;
  
  public class AudioToText {
      public static void main(String [] args) throws FileNotFoundException,IOException{
          Configuration configuration = new Configuration();
  
          // Set path to acoustic model.
          configuration.setAcousticModelPath("C:/Program Files/eclipse/sphinx4-5prealpha/models/acoustic");
          // Set path to dictionary.
          configuration.setDictionaryPath("C:/Program Files/eclipse/sphinx4-5prealpha/models/acoustic/wsj/dict/cmudict.0.6d");
          // Set language model.
          configuration.setLanguageModelPath("C:/Program Files/eclipse/sphinx4-5prealpha/models/language/en-us.lm.dmp");
  
          StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(configuration);
          //recognizer.startRecognition(new File("D:/audio.mp3").toURI().toURL());
          recognizer.startRecognition(new FileInputStream("D:/audio.mp3"));
          SpeechResult result;
          while ((result = recognizer.getResult()) != null) {
              System.out.println(result.getHypothesis());
          }
          recognizer.stopRecognition();
      }
  }
  </code></pre>
  
  <p>Exceptions are arising because of not setting the path of acoustic model correctly as mentioned below:</p>
  
  <pre><code>   Exception in thread "main" Property exception component:'acousticModelLoader' property:'location' - Bad URL C:/Program Files/eclipse/sphinx4-5prealpha/models/acousticunknown protocol: c
  edu.cmu.sphinx.util.props.InternalConfigurationException: Bad URL C:/Program Files/eclipse/sphinx4-5prealpha/models/acousticunknown protocol: c
      at edu.cmu.sphinx.util.props.ConfigurationManagerUtils.getResource(ConfigurationManagerUtils.java:479)
      at edu.cmu.sphinx.linguist.acoustic.tiedstate.Sphinx3Loader.newProperties(Sphinx3Loader.java:246)
      at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:508)
      at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.java:290)
      at edu.cmu.sphinx.linguist.acoustic.tiedstate.TiedStateAcousticModel.newProperties(TiedStateAcousticModel.java:102)
      at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:508)
      at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.java:290)
      at edu.cmu.sphinx.linguist.lextree.LexTreeLinguist.newProperties(LexTreeLinguist.java:301)
      at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:508)
      at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.java:290)
      at edu.cmu.sphinx.decoder.search.WordPruningBreadthFirstSearchManager.newProperties(WordPruningBreadthFirstSearchManager.java:199)
      at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:508)
      at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.java:290)
      at edu.cmu.sphinx.decoder.AbstractDecoder.newProperties(AbstractDecoder.java:71)
      at edu.cmu.sphinx.decoder.Decoder.newProperties(Decoder.java:37)
      at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:508)
      at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.java:290)
      at edu.cmu.sphinx.recognizer.Recognizer.newProperties(Recognizer.java:90)
      at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:508)
      at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:161)
      at edu.cmu.sphinx.api.Context.&lt;init&gt;(Context.java:77)
      at edu.cmu.sphinx.api.Context.&lt;init&gt;(Context.java:49)
      at edu.cmu.sphinx.api.AbstractSpeechRecognizer.&lt;init&gt;(AbstractSpeechRecognizer.java:37)
      at edu.cmu.sphinx.api.StreamSpeechRecognizer.&lt;init&gt;(StreamSpeechRecognizer.java:33)
      at AudioToText.main(AudioToText.java:21)
  Caused by: java.net.MalformedURLException: unknown protocol: c
      at java.net.URL.&lt;init&gt;(URL.java:574)
      at java.net.URL.&lt;init&gt;(URL.java:464)
      at java.net.URL.&lt;init&gt;(URL.java:413)
      at edu.cmu.sphinx.util.props.ConfigurationManagerUtils.resourceToURL(ConfigurationManagerUtils.java:495)
      at edu.cmu.sphinx.util.props.ConfigurationManagerUtils.getResource(ConfigurationManagerUtils.java:472)
  </code></pre>
  
  <p>I have specified path to acoustic folder. How to specify the correct path? </p>