W
Wraithious
Guest
Hi,
I am working on making a text to speech android extension for gamemaker studio, I'm getting this error: 05-01 17:16:41.304 16939 17013 I yoyo : Can't find argfree method on extension class:getMic [] when trying to use my extension in-game. the game doesn't crash, it just can't find anything in the extension. So what exactly is an argfree method?
I also tried tried changing the onCreate method to a public method and calling it from GM:S and several other things but no luck. Here is the relevant code, if you need more info please ask.
this part of the java class TtsStt is causing the error when called:
in the activity level In my manifest I have injected this:
and injected the gradle dependencies in the manifest:
I am working on making a text to speech android extension for gamemaker studio, I'm getting this error: 05-01 17:16:41.304 16939 17013 I yoyo : Can't find argfree method on extension class:getMic [] when trying to use my extension in-game. the game doesn't crash, it just can't find anything in the extension. So what exactly is an argfree method?
I also tried tried changing the onCreate method to a public method and calling it from GM:S and several other things but no luck. Here is the relevant code, if you need more info please ask.
this part of the java class TtsStt is causing the error when called:
Code:
protected void onCreate(Bundle savedInstanceState) { //HERE is where I tried replacing
//protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);
//with just public void initTTS() {...} but got same error
super.onCreate(savedInstanceState);
setContentView(R.layout.tts_stt);
preferences = getSharedPreferences(PREFS,0);
editor = preferences.edit();
editor.putString(TSTYLE, "military time").apply();
RunnerActivity.CurrentActivity.findViewById(R.id.microphoneButton).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listen();
}
});
loadQuestions();
tts = new TextToSpeech(RunnerActivity.CurrentActivity, new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS) {
int result = tts.setLanguage(Locale.US);
if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
Log.i("yoyo", "This Language is not supported");
}
speak("Hello");
} else {
Log.i("yoyo", "Initilization Failed!");
}
}
});
}
public void getMic() {
listen();
}
private void listen(){
Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
i.putExtra(RecognizerIntent.EXTRA_PROMPT, "Say something");
try {
RunnerActivity.CurrentActivity.startActivityForResult(i, 100);
} catch (ActivityNotFoundException a) {
Log.i("yoyo", "Your device doesn't support Speech Recognition");
}
}
Code:
<activity android:name="${YYAndroidPackageName}.TtsStt"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<category android:name="android.intent.category.LAUNCHER" />
/>
/>
Code:
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'