gamemakerスタジオ用の音声アンドロイド拡張機能を作成するために作業中です。 05-01 17:16:41.304 16939 17013 I yoyo:拡張クラスでargfreeメソッドを見つけることができません:getMic [] ゲーム内でエクステンションを使用しようとしています。ゲームがクラッシュすることはなく、拡張機能では何も見つかりません。 argfreeメソッドは正確には何ですか?GAMEMAKER STUDIO用の拡張子はありません。拡張クラスのargfreeメソッドを見つける
また、onCreateメソッドをパブリックメソッドに変更し、GM:Sと他のいくつかのものから呼び出してみましたが、運がないと試してみました。ここに関連コードがあります
JavaクラスTtsStt:
<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" />
/>
/>
とマニフェストにGradleの依存関係を注入された:私はこれを注射している
私のマニフェストに活動レベルの 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");
}
}
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'