java - InputStream and URL incompatibility -


I'm working in Eclipse Heliojage Java 1.6. I downloaded CMU Spinx-4 and added to the Java project. The code below has to convert the audio file to a text file.

Import java.io.File; Import edu.cmu.sphinx.api.configuration; Import edu.cmu.sphinx.api.SpeechResult; Import edu.cmu.sphinx.api.StreamSpeechRecognizer; Public class audiotap text {public static zero main (string [] args) {configuration configuration = new configuration (); // Set Path for Acoustic Model Configuration.setAcousticModelPath ("C: / Program Files / Eclipse / Speaks 4-5 Preludes / Models / Acoustic"); Set the Path to // Dictionary Configuration.setDictionaryPath ("C: / Program Files / Eclipse / Speaks 4-5 Prelofa / Models / Acoustic / wsj / dict / cmudict.0.6d"); // Set language model configuration. The language model path ("C: / program files / eclipse / spinx 4-5 prelofa / model / language / n-us.lm.dmp"); StreamPrecise identifier = new StreamPresicator (configuration); Identifier Initial recognition (new file ("D: / audio. MP3"). ToURI (.) ToURL ()); Speech result result = identifier .getResult (); Recognizer.stopRecognition (); }}

The error is in line:

  identifier. Initial recognition (new file ("D: /Odio.mpe."). ToURI (.) ToURL ());  

Error:

  - method is not applicable for argument (URL) in startRecognition (InputStream) type StreamSpeechRecognizer - method startRecognition (InputStream) type (streaming) ) - Line breakpoint: AudioToText [Line: 19] - Main (string [])  

When I first saw (recognition) definition ,

Public Zero Starter (Input Stream Stream) {identizer.allocate (); Context.setSpeechSource (stream); }

How to fix this compatibility problem? Code is taken from

The upgrade can be expensive from the helioz or Java 1.6, because many previous codes are written on helio and java 1.6.

The method requires an InputStream logic, you < Code> file or

instead.

.mp3 "));


Comments