小编Kai*_*har的帖子

IllegalArgumentException:无效int:使用Samsung tts的"OS"

我在我的android应用程序中使用Text to speech.它与Google TTs和espeak工作正常,但是当我使用Samsung TTS时,它会给出以下异常.

java.lang.IllegalArgumentException: Invalid int: "OS"
at android.os.Parcel.readException(Parcel.java:1429)
at android.os.Parcel.readException(Parcel.java:1379)
at android.speech.tts.ITextToSpeechService$Stub$Proxy.isLanguageAvailable(ITextToSpeechService.java:482)
at android.speech.tts.TextToSpeech$10.run(TextToSpeech.java:1084)

at android.speech.tts.TextToSpeech$10.run(TextToSpeech.java:1081)
at android.speech.tts.TextToSpeech$Connection.runAction(TextToSpeech.java:1329)

at android.speech.tts.TextToSpeech.runAction(TextToSpeech.java:570)

at android.speech.tts.TextToSpeech.runAction(TextToSpeech.java:561)

at android.speech.tts.TextToSpeech.isLanguageAvailable(TextToSpeech.java:1081)
Run Code Online (Sandbox Code Playgroud)

android exception text-to-speech

31
推荐指数
1
解决办法
2633
查看次数

获取默认TTS的选定语言

我在我的Android应用程序中实现了tts.它支持Android设备中默认TTS支持的所有语言.但是有可能获得在默认TTS中选择的语言名称,即在设置中在Google TTS中选择的语言名称吗?

android text-to-speech

2
推荐指数
1
解决办法
1055
查看次数

"双指滑动"手势?

我想在我的Android应用程序中实现两个手指轻扫手势.我使用了以下代码:

void handleTouch(MotionEvent m){
//Number of touches
int pointerCount = m.getPointerCount();
if(pointerCount == 2){
    int action = m.getActionMasked();
    int actionIndex = m.getActionIndex();
    String actionString;
    TextView tv = (TextView) findViewById(R.id.testDiffText);
    switch (action)
    {
        case MotionEvent.ACTION_DOWN:                   
            GLOBAL_TOUCH_POSITION_X = (int) m.getX(1);
            actionString = "DOWN"+" current "+GLOBAL_TOUCH_CURRENT_POSITION_X+" prev "+GLOBAL_TOUCH_POSITION_X;
            tv.setText(actionString);
            break;
        case MotionEvent.ACTION_UP:                 
            GLOBAL_TOUCH_CURRENT_POSITION_X = 0;
            actionString = "UP"+" current "+GLOBAL_TOUCH_CURRENT_POSITION_X+" prev "+GLOBAL_TOUCH_POSITION_X;
            tv.setText(actionString);  
            break;  
        case MotionEvent.ACTION_MOVE:
            GLOBAL_TOUCH_CURRENT_POSITION_X = (int) m.getX(1);
            int diff = GLOBAL_TOUCH_POSITION_X-GLOBAL_TOUCH_CURRENT_POSITION_X;
            actionString = "Diff "+diff+" current "+GLOBAL_TOUCH_CURRENT_POSITION_X+" prev "+GLOBAL_TOUCH_POSITION_X;
            tv.setText(actionString); …
Run Code Online (Sandbox Code Playgroud)

android swipe

-3
推荐指数
1
解决办法
3804
查看次数

标签 统计

android ×3

text-to-speech ×2

exception ×1

swipe ×1