android


Reduce Microphone senstity on Samsung


I'm using a bit of code to open google mic and record phrases to save in a TextView .
However the mic stays open for awhile when there is background noise.
Is there a way to either reduce the mic sensivity (I have trawelled through android settings and can not resolve)
or can the code open mic for like only 10 seconds or something ?
Heres the code I am using
Thanks
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main3);
String savedExtra = getIntent().getStringExtra("value1");
TextView myText = (TextView) findViewById(textView5);
myText.setText(savedExtra);
txtSpeechInput = (TextView) findViewById(R.id.txtSpeechInput);
btnSpeak = (Button) findViewById(R.id.btnSpeak);
//String textID = selectedValue;
// hide the action bar
//getActionBar().hide();
btnSpeak.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
promptSpeechInput();
}
});
}
/**
* Showing google speech input dialog
*/
private void promptSpeechInput() {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
getString(R.string.speech_prompt));
try {
startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);
} catch (ActivityNotFoundException a) {
Toast.makeText(getApplicationContext(),
getString(R.string.speech_not_supported),
Toast.LENGTH_SHORT).show();
}
}
/**
* Receiving speech input
*/
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case REQ_CODE_SPEECH_INPUT: {
if (resultCode == RESULT_OK && null != data) {
ArrayList<String> result = data
.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
//this is test
StringBuilder sb = new StringBuilder(txtSpeechInput.getText().toString());
//sb.append(result.get(0));
sb.append("\r\n").append(result.get(0));
txtSpeechInput.setText(sb.toString());
//txtSpeechInput.setText(result.get(0));
}
// TextView theFact = (TextView) findViewById(R.id.txtSpeechInput);
// String shareFact = theFact.getText().toString();
break;
}
enter code here

Related Links

Click on image do not respond on first time, need to click it again, Why?
How to refresh GridView without moving it?
How to publish a paid app to play sore
What exactly are the numbers in logcat's GC_CONCURRENT saying? [duplicate]
Am newbie to JSON and android as well, Am not getting how to parse the inside “options” JSONArray
Mifare classic - what is the address byte for, and how does it work
Not able to login in facebook with facebook sdk 3.0 loginbutton button using other users, though it is working with developers login credentials
How to write text more than 10 letters using Canvas and paint on map?
Strange results while compressing batch of pictures with libjpegturbo
Android Studio: apache.http.entity.mime does not exist
What color should have an icon when used in Action Bar
TextViews with dividers in between them
google inapp details in android
TWITTER4J - Filter tweets by location: tweets outside defined area
Monitoring app launches on android
Android Contacts Plugin or option

Categories

HOME
windows
powerpoint
rsa
yahoo-finance
shiro
google-cloud-functions
gembox-spreadsheet
google-cloud-datalab
character
reactive-programming
watson-conversation
plist
job-scheduling
html5-appcache
imessage
microsoft-ocr
babel
jquery-callback
appirater
fractions
twiml
powershell-ise
zend-debugger
mockjax
angularjs-material
glib
laravel-eloquent
android-sugarorm
activexobject
getpixel
fiware-cygnus
apiary.io
magento-1.9.2.4
xdocreport
modernizr
nohup
connection-pool
stringtokenizer
naming
install.packages
knime
stylecop
carrot2
pair-programming
stdmap
oracleclient
jqchart
gameplay-kit
ampps
rxtx
filenet
atlas
grails-plugin
winusb
dimension
shopping
jtwig
mediametadataretriever
bizagi
fuzzywuzzy
aspen
np-spring
jparsec
jbase
r-package
forwarding
video-player
zen-cart
typeconverter
teamcity-9.1
entity-framework-4.3
dot.js
grouping-sets
android-cookiemanager
contrast
iso-prolog
dsym
gae-quotas
sphinxql
script#
ui-select2
kaleidoscope
swfobject
idn
paginator
cuda-gdb
thttpd
fusefabric
predicatebuilder
promotion-code
listactivity
http-daemon
ruby-1.8
silent
binomial-heap
zen
interop-domino
httpcookie
commercial-application

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App