commit
b80e3fd410
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
|
@ -5,7 +5,7 @@ android {
|
|||
buildToolsVersion "25.0.2"
|
||||
defaultConfig {
|
||||
applicationId "com.example.yink.amadeus"
|
||||
minSdkVersion 15
|
||||
minSdkVersion 9
|
||||
targetSdkVersion 25
|
||||
versionCode 1
|
||||
versionName "0.7.5-beta.1"
|
||||
|
|
|
@ -35,27 +35,31 @@ public class LaunchActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public void onClick(View view) {
|
||||
if (!isPressed) {
|
||||
isPressed = true;
|
||||
MediaPlayer m = MediaPlayer.create(getApplicationContext(), R.raw.tone);
|
||||
try {
|
||||
isPressed = true;
|
||||
MediaPlayer m = MediaPlayer.create(getApplicationContext(), R.raw.tone);
|
||||
|
||||
connect.setImageResource(R.drawable.connect_select);
|
||||
connect.setImageResource(R.drawable.connect_select);
|
||||
|
||||
m.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
mp.start();
|
||||
status.setText(R.string.connecting);
|
||||
}
|
||||
});
|
||||
m.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
mp.start();
|
||||
status.setText(R.string.connecting);
|
||||
}
|
||||
});
|
||||
|
||||
m.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
mp.release();
|
||||
Intent intent = new Intent(LaunchActivity.this,MainActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
m.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
mp.release();
|
||||
Intent intent = new Intent(LaunchActivity.this,MainActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -39,6 +39,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
ArrayList<VoiceLine> voiceLines = new ArrayList<>();
|
||||
int shaman_girls = -1;
|
||||
private SpeechRecognizer sr;
|
||||
Random randomgen = new Random();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -61,7 +62,6 @@ public class MainActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public void run() {
|
||||
if (isLoop) {
|
||||
Random randomgen = new Random();
|
||||
speak(voiceLines.get(randomgen.nextInt(voiceLines.size())));
|
||||
handler.postDelayed(this, 5000 + randomgen.nextInt(5) * 1000);
|
||||
}
|
||||
|
@ -130,7 +130,6 @@ public class MainActivity extends AppCompatActivity {
|
|||
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
|
||||
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
|
||||
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "ja-JP");
|
||||
intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, "com.example.yink.amadeus");
|
||||
|
||||
sr.startListening(intent);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue