I make a demo for speech recognize to text. I have just built the demo Building Pocketsphinx On Android and it work well. But my problem is how to make input from an audio file, not from real time speaking. Any idea to solve it? Thanks.
相关问题
- How can I create this custom Bottom Navigation on
- Can we recover audio from MFCC coefficients?
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
You can use Pocketsphinx API to process any binary data, including binary data read from file. You only need to make sure that data is in the required format. Once you read the binary data into the buffer of type short[] you can process it using pocketsphinx API calls:
import edu.cmu.pocketsphinx.pocketsphinx;
After all data is processed you can retrieve the result
For more details see the Pocketsphinx part of the CMUSphinx tutorial
Although a little late in the day, hope it might be of help to someone else looking to address similar requirements. Have a look at the following code in
SpeechRecognizer
class in particular at Declaring AudioRecord object AudioRecord recorder = new AudioRecord( AudioSource.VOICE_RECOGNITION, sampleRate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, bufferSize * 2); Creating another class like SpeechRecognizer, you could choose any of the audio sources supported byMediaRecord