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

Resize the height of the ListView Row in Android?
Android Nexus 10 Emulator not running properly [duplicate]
Android SQLite Create Table Issue
Android: App has stopped working issue
I want to create a compiler in android for C language like C4droid app
Titanium Studio cannot install Android SDK
Service and background music codes -updated-
Specify filename in ContentProvider
ClassCastException android.widget.FrameLayout$LayoutParams to android.support.v4.widget.DrawerLayout$LayoutParams
Why service is re-started after the application process is killed
org.json.JSONException: Value < of type java.lang.String cannot be converted to JSONObject
how to solve android.os.NetworkOnMainThreadException in json [duplicate]
Android ndk-build: “error: undefined reference to 'std::__throw_bad_alloc()”
How to add Background processing permission to BB10 App ported from android?
How to work out MultipleChoice filters on Listview using checkbox
Get Bitmap from universal image loader

Categories

HOME
phantom-dsl
prism
deep-learning
wakanda
case
static
fftw
jelastic
vscode-extensions
simulink
visual-studio-emulator
nested-if
odoo-8
nfs
special-characters
sendgrid-api-v3
github-enterprise
speech-synthesis
scrolltop
esoteric-languages
mvc-mini-profiler
fileserver
google-maps-autocomplete
easeljs
carrierwave
finagle
r-grid
memory-address
linkedhashmap
twos-complement
imx6
python-pptx
raft
sql-server-ce
reactivekit
flatmap
railstutorial.org
mongoose-schema
odoo-website
http-request
placeholder
android-checkbox
importerror
apache-spark-dataset
flask-login
facebook-social-plugins
httr
phpdbg
cnc
robomongo
vugen
openblas
corruption
appdomain
flac
swingworker
donations
redistributable
burrows-wheeler-transform
uicolor
watch-os-2
x-tag
mapinfo
nservicebus5
cassia
stream-processing
nupic
cycle2
highland.js
assertion
gocql
file-move
binomial-theorem
jdk1.7
teamcity-9.1
snackbar
public-html
document-repository
ejb-2.x
uncaught-typeerror
big-ip
winginx
drupal-nodes
git-repo
ecslidingviewcontroller
unit-of-work
beaker-testing
nevron
ui-select2
poker
css-reset
mysql-error-2013
curb
iboutlet
subproject
azman
ilasm
infobright
stress
gobject-introspection
android-holo-everywhere
creole
mbeans
codebase
cloudfiles
svk
non-clustered-index
jqueryform
fail-fast-fail-early
online-storage

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