Actually, "make the Sphinx4 audio stream input in here with in[i]" is maybe wrong.
I just need to feed the AudioInputStream from the samples coming from in[] (where 'in[]' has floats).
The loop can be used to get input samples one by one inside a single dsp vector size.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have started to implement Sphinx4 in Max/MSP ( http://www.cycling74.com ).
I'm trying to get rid of the Microphone in Sphinx4 and use in[i] (with AudioData()?).
QUESTION : How can I get rid of the stream from the system (microphone) and replace it by an audio stream (the one from Max) in the form of in[i]?
Thank you!
hi!
I'm still trying to have something like ( ins[0].vec is the vector from the live sound input ):
method {
int i;
float[] in = ins[0].vec;
for(i = 0; i < in.length;i++)
{ make the Sphinx4 audio stream input in here with in[i] }
}
thank you very much!
Hi
Have a look at the Transcriber Demo Program shipped with Sphinx4.
Good Luck
In the Transcriber demo, you have
AudioInputStream ais = AudioSystem.getAudioInputStream(audioURL);
With audioURL is a sound file.
The max input is a stream of float values as a stream of data (realtime). I need something like:
method {
int i;
float[] in = ins[0].vec;
for(i = 0; i < in.length;i++)
{ make the Sphinx4 audio stream input in here with in[i] }
}
microphone.java does the job but it uses AudioInputStream and AudioSystem.
I looked in StreamDAtaSource but...
short[i] shortin = (short)in[i];
StreamDataSource reader = (StreamDataSource) cm.lookup("streamDataSource");
reader.setInputStream( new AudioInputStream(shortin), "streamName");
Actually, "make the Sphinx4 audio stream input in here with in[i]" is maybe wrong.
I just need to feed the AudioInputStream from the samples coming from in[] (where 'in[]' has floats).
The loop can be used to get input samples one by one inside a single dsp vector size.