I am using SppechRecognizer for voice recognizer application. Its working fine. My requirement is i want to stop the voice listening after 1 sec or 2 sec. How to achieve that?
相关问题
- 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
1 or 2 seconds doesn't seem to be a lot of time but if you want to set a time limit, you'd probably have to thread it. Android has some default extras to set the minimum length of speech input and maximum amount after a user has stopped speaking, but none to set the maximum length of time for speech input.
Your best bet would be to thread some sort of timer, something like a CountDownTimer:
I would also encourage you to look at the extras available for the RecognizerIntent to see if there's anything more suitable to your needs.