Help needed with extension, onActivityResult lost

Discussion in 'Advanced Programming Discussion' started by Wraithious, May 8, 2017.

  1. Wraithious

    Wraithious Member

    Joined:
    Jun 24, 2016
    Posts:
    1,166
    Hi, I'm making a speech to text / text to speech extension for android and altho the text to speech works perfect, the get speech to text doesn't work, it is not getting the results from the onActivityResult method, can any of you extension geniuses help me out as to why? I have tried the following in about 50 different ways but no luck, what am I doing wrong? I've looked at a extension that used onActivityResult and tried setting it up exactly like they did but it doesn't work (the extension was for picking media files from android device)
    here's the relitive codes to how it's set up:

    GAMEMAKER
    left mouse press event:
    Code:
    getMic();
    EXTENSION
    get the microphone for listning:
    Code:
    public void getMic() {
            Log.i("yoyo", "Listening for speech");
            try {
               j = new Intent();
               j.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
                j.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
                j.putExtra(RecognizerIntent.EXTRA_PROMPT, "Say something");
               j.setAction(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
                RunnerActivity.CurrentActivity.startActivityForResult(j, 100);
                Log.i("yoyo", "send to onActivityResult, Data: " + String.valueOf(j));
            } catch (ActivityNotFoundException a) {
                Log.i("yoyo", "Your device doesn't support Speech Recognition");
            }
    
        }
    EXTENSION
    get our results from speaking and save them internally:
    Code:
    @Override
        protected void onActivityResult(int requestCode, int resultCode, Intent data) {
                    Log.i("yoyo", "onActivityResult, requestCode: " + requestCode + ", resultCode: " + resultCode);
           (RunnerActivity.CurrentActivity).onActivityResult(requestCode, resultCode, data);
            if(requestCode == 100){
                if (resultCode == RESULT_OK && data != null) {
                    ArrayList<String> res = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
                    holdForGMS = String.valueOf(res.get(0));
                    editor.putString(GETMYSPEECH, holdForGMS).apply();
                }
            }
        }
    GAMEMAKER
    retrieve the results from memory GMS side, in alarm event that fires after speaking:
    Code:
    if global.isSpeaking=1 findMySpeech();
    global.isSpeaking=0;
    EXTENSION
    findMySpeach method:
    Code:
        public void findMySpeech() {
        String gmsar = preferences.getString(GETMYSPEECH,"");
        Log.i("yoyo", "Spoken words- " + gmsar);
        recognition(gmsar);
        }
    aaaaannnd it's gone. the log results show it got a result in onActivityResult but never shared it with GMS and didn't save the result in the preference editor either, here is the log:
    Code:
    05-08 14:17:14.893 28146 28204 I yoyo    : chooseConfig
    05-08 14:17:14.898 28146 28204 I yoyo    : OpenGL ES Extensions : GL_EXT_debug_marker GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth24 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_OES_EGL_sync GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_required_internalformat GL_OES_vertex_array_object GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_type_2_10_10_10_REV GL_OES_fbo_render_mipmap GL_OES_element_index_uint GL_EXT_shadow_samplers GL_OES_texture_compression_astc GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_KHR_texture_compression_astc_sliced_3d GL_KHR_debug GL_EXT_occlusion_query_boolean GL_EXT_disjoint_timer_query GL_EXT_blend_minmax GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_OES_texture_3D GL_EXT_texture_storage GL_EXT_multisampled_render_to_texture GL_OES_surfaceless_context GL_OES_texture_stencil8 GL_EXT_shader_pixel_local_storage GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_ARM_mali_program_binary GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_RG8 GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OES_texture_storage_multisample_2d_array GL_OES_shader_image_atomic GL_EXT_robustness GL_EXT_draw_buffers_indexed GL_OES_draw_buffers_indexed GL_EXT_texture_border_clamp GL_OES_texture_border_clamp GL_EXT_texture_cube_map_array GL_OES_texture_cube_map_array GL_OES_sample_variables GL_OES_sample_shading GL_OES_shader_multisample_interpolation GL_EXT_shader_io_blocks GL_OES_shader_io_blocks GL_EXT_tessellation_shader GL_OES_tessellation_shader GL_EXT_primitive_bounding_box GL_OES_primitive_bounding_box GL_EXT_geometry_shader GL_OES_geometry_shader GL_ANDROID_extension_pack_es31a GL_EXT_gpu_shader5 GL_OES_gpu_shader5 GL_EXT_texture_buffer GL_OES_texture_buffer GL_EXT_copy_image GL_OES_copy_image GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float GL_EXT_YUV_target GL_OVR_multiview GL_OVR_multiview2 GL_OVR_multiview_multisampled_render_to_texture GL_KHR_robustness GL_KHR_robust_buffer_access_behavior GL_EXT_draw_elements_base_vertex GL_OES_draw_elements_base_vertex GL_EXT_protected_textures
    05-08 14:17:14.898 28146 28204 I yoyo    : Device supports 32bit display formats
    05-08 14:17:14.899 28146 28204 I yoyo    : 16 bit colour depth forced
    05-08 14:17:14.900 28146 28204 I yoyo    : Trying EGL config : EGLConfig 7: rgba=5650 depth=24 stencil=8 EGL_ALPHA_MASK_SIZE=0 EGL_BUFFER_SIZE=16 EGL_COLOR_BUFFER_TYPE=12430 EGL_CONFIG_CAVEAT=0x3038 EGL_LEVEL=0 EGL_LUMINANCE_SIZE=0 EGL_MAX_PBUFFER_WIDTH=8192 EGL_MAX_PBUFFER_HEIGHT=8192 EGL_MAX_PBUFFER_PIXELS=67108864 EGL_MAX_PBUFFER_HEIGHT=8192 EGL_MAX_PBUFFER_HEIGHT=8192 EGL_NATIVE_RENDERABLE=0 EGL_NATIVE_VISUAL_TYPE=4 EGL_RENDERABLE_TYPE=69 EGL_SAMPLE_BUFFERS=0 EGL_SAMPLES=0 EGL_SURFACE_TYPE=5125 EGL_TRANSPARENT_TYPE=12344 EGL_TRANSPARENT_RED_VALUE=0 EGL_TRANSPARENT_GREEN_VALUE=0 EGL_TRANSPARENT_BLUE_VALUE=0
    05-08 14:17:14.902 28146 28204 I yoyo    : Selected EGL config working
    05-08 14:17:14.916 28146 28204 I yoyo    : Renderer instance is gl2.0, framebuffer object is: 0
    05-08 14:17:14.919 28146 28204 I yoyo    : APK File Path :: /data/app/com.roadhammergaming.GM_Android_Text_to_Speech-2/base.apk
    05-08 14:17:14.925 28146 28204 I yoyo    : OpenGL ES-2.0 is supported: 196610
    05-08 14:17:14.957 28146 28204 I yoyo    : onSurfaceChanged :: width=2560 height=1440
    05-08 14:17:14.957 28146 28204 I yoyo    : State->Splash
    05-08 14:17:14.973 28146 28204 I yoyo    : State->Splash    time: 1494267434973
    05-08 14:17:14.974 28146 28204 I yoyo    : State->Splash endTime: 1494267434973
    05-08 14:17:14.974 28146 28204 I yoyo    : State->Splash2
    05-08 14:17:14.983 28146 28204 I yoyo    : RenderSplashCheck1.1
    05-08 14:17:14.983 28146 28204 I yoyo    : RenderSplashCheck1.2
    05-08 14:17:14.983 28146 28204 I yoyo    : RenderSplashCheck1.3
    05-08 14:17:14.994 28146 28204 I yoyo    : RenderSplashCheck1.4
    05-08 14:17:14.994 28146 28204 I yoyo    : RenderSplashCheck1.6
    05-08 14:17:14.994 28146 28204 I yoyo    : RenderSplashCheck1.7
    05-08 14:17:15.010 28146 28204 I yoyo    : !!! Asset file - /storage/emulated/0/GMstudio/GameAssetsDROID.zip true l=1494267428000
    05-08 14:17:15.010 28146 28204 I yoyo    : !!! Lock file - /storage/emulated/0/GMstudio/GameDownload.lock true l=1494267428000
    05-08 14:17:15.011 28146 28204 I yoyo    : GameDownload.lock exists, about to delete...
    05-08 14:17:15.011 28146 28204 I yoyo    : After delete flock.exists() returns false
    05-08 14:17:15.105 28146 28146 I yoyo    : onWindowFocusChanged(true|false)
    05-08 14:17:15.106 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:15.126 28146 28146 D yoyo    : doSetup called - /storage/emulated/0/GMstudio/GameAssetsDROID.zip
    05-08 14:17:15.126 28146 28146 I yoyo    : checking 1 extensions for ad interface
    05-08 14:17:15.126 28146 28146 I yoyo    : BILLING: setupInAppBilling
    05-08 14:17:15.128 28146 28146 I yoyo    : Exception thrown trying to call method InitRunnerBilling on GooglePlayServicesExtension
    05-08 14:17:15.129 28146 28146 I yoyo    : BILLING: Google Play permissions not available, selecting NULL billing solution
    05-08 14:17:15.129 28146 28146 I yoyo    : -----setup Push------
    05-08 14:17:15.156 28146 28146 I yoyo    : GAMEPAD: Bonded Bluetooth devices read
    05-08 14:17:15.158 28146 28146 D yoyo    : ****** Found API level 12 function! Joysticks supported
    05-08 14:17:15.164 28146 28146 I yoyo    : GAMEPAD: Enumeration complete
    05-08 14:17:15.164 28146 28146 I yoyo    : RestrictOrientation setting from YYPrefs
    05-08 14:17:15.164 28146 28146 I yoyo    : RestrictOrientation("true", "false"true"false")
    05-08 14:17:15.170 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:15.217 28146 28204 I yoyo    : Attempting to set gamepadcount to 1
    05-08 14:17:15.240 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:15.303 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:15.607 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:15.672 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:15.700 28146 28204 W yoyo    : AL lib: (EE) alc_opensl_init: Using OpenSLES
    05-08 14:17:15.701 28146 28204 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_ENGINE :: ea919dac
    05-08 14:17:15.701 28146 28204 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_ANDROIDSIMPLEBUFFERQUEUE :: ea919e2c
    05-08 14:17:15.701 28146 28204 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_BUFFERQUEUE :: ea919d98
    05-08 14:17:15.701 28146 28204 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_PLAY :: ea919dec
    05-08 14:17:15.702 28146 28204 W yoyo    : AL lib: (EE) opensl_open_playback: engine->GetInterface 0 -- 0xd77253dc
    05-08 14:17:15.702 28146 28204 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: ea919e18
    05-08 14:17:15.719 28146 28204 I yoyo    : android.software.leanback = 0
    05-08 14:17:15.719 28146 28204 I yoyo    : MANUFACTURER = samsung
    05-08 14:17:18.589 28146 28204 I yoyo    : Time allready set to military time
    05-08 14:17:18.589 28146 28204 I yoyo    : Preferred language is usa
    05-08 14:17:18.589 28146 28204 I yoyo    : Listening for speech
    05-08 14:17:18.686 28627 28627 I AndroidRuntime: VM exiting with result code 0, cleanup skipped.
    05-08 14:17:18.688 28146 28146 I yoyo    : onWindowFocusChanged(false|false)
    05-08 14:17:18.690 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:18.691 28146 28146 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: ea919e18
    05-08 14:17:18.703 28146 28204 I yoyo    : send to onActivityResult, Data: Intent { act=android.speech.action.RECOGNIZE_SPEECH launchParam=MultiScreenLaunchParams { mDisplayId=0 mFlags=0 } (has extras) }
    05-08 14:17:18.707 28146 28146 I yoyo    : onPause
    05-08 14:17:18.713 28146 28146 I yoyo    : Pausing the Runner
    05-08 14:17:18.713 28146 28146 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: ea919e18
    05-08 14:17:19.190 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:19.211 28146 28146 I yoyo    : TtsStt initialized!
    05-08 14:17:19.211 28146 28146 I yoyo    : Sent social async event to GM:S
    05-08 14:17:19.211 28146 28146 I yoyo    : Text to be spoken- Hello
    05-08 14:17:19.218 28146 28146 I yoyo    : Sent social async event to GM:S
    05-08 14:17:19.645 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:20.146 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:23.159 28146 28146 I yoyo    : Got activity result: -1
    05-08 14:17:23.164 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:23.164 28146 28146 I yoyo    : End Got activity result
    05-08 14:17:23.166 28146 28146 I yoyo    : onResume
    05-08 14:17:23.186 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:23.229 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:23.230 28146 28146 I yoyo    : onWindowFocusChanged(true|false)
    05-08 14:17:23.231 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:23.231 28146 28146 I yoyo    : resumeApp
    05-08 14:17:23.242 28146 28146 I yoyo    : GAMEPAD: Bonded Bluetooth devices read
    05-08 14:17:23.244 28146 28146 D yoyo    : ****** Found API level 12 function! Joysticks supported
    05-08 14:17:23.247 28146 28146 I yoyo    : GAMEPAD: Enumeration complete
    05-08 14:17:23.247 28146 28204 I yoyo    : chooseConfig
    05-08 14:17:23.257 28146 28204 I yoyo    : OpenGL ES Extensions : GL_EXT_debug_marker GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth24 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_OES_EGL_sync GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_required_internalformat GL_OES_vertex_array_object GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_type_2_10_10_10_REV GL_OES_fbo_render_mipmap GL_OES_element_index_uint GL_EXT_shadow_samplers GL_OES_texture_compression_astc GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_KHR_texture_compression_astc_sliced_3d GL_KHR_debug GL_EXT_occlusion_query_boolean GL_EXT_disjoint_timer_query GL_EXT_blend_minmax GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_OES_texture_3D GL_EXT_texture_storage GL_EXT_multisampled_render_to_texture GL_OES_surfaceless_context GL_OES_texture_stencil8 GL_EXT_shader_pixel_local_storage GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_ARM_mali_program_binary GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_RG8 GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OES_texture_storage_multisample_2d_array GL_OES_shader_image_atomic GL_EXT_robustness GL_EXT_draw_buffers_indexed GL_OES_draw_buffers_indexed GL_EXT_texture_border_clamp GL_OES_texture_border_clamp GL_EXT_texture_cube_map_array GL_OES_texture_cube_map_array GL_OES_sample_variables GL_OES_sample_shading GL_OES_shader_multisample_interpolation GL_EXT_shader_io_blocks GL_OES_shader_io_blocks GL_EXT_tessellation_shader GL_OES_tessellation_shader GL_EXT_primitive_bounding_box GL_OES_primitive_bounding_box GL_EXT_geometry_shader GL_OES_geometry_shader GL_ANDROID_extension_pack_es31a GL_EXT_gpu_shader5 GL_OES_gpu_shader5 GL_EXT_texture_buffer GL_OES_texture_buffer GL_EXT_copy_image GL_OES_copy_image GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float GL_EXT_YUV_target GL_OVR_multiview GL_OVR_multiview2 GL_OVR_multiview_multisampled_render_to_texture GL_KHR_robustness GL_KHR_robust_buffer_access_behavior GL_EXT_draw_elements_base_vertex GL_OES_draw_elements_base_vertex GL_EXT_protected_textures
    05-08 14:17:23.257 28146 28204 I yoyo    : Device supports 32bit display formats
    05-08 14:17:23.259 28146 28204 I yoyo    : 16 bit colour depth forced
    05-08 14:17:23.260 28146 28204 I yoyo    : Trying EGL config : EGLConfig 7: rgba=5650 depth=24 stencil=8 EGL_ALPHA_MASK_SIZE=0 EGL_BUFFER_SIZE=16 EGL_COLOR_BUFFER_TYPE=12430 EGL_CONFIG_CAVEAT=0x3038 EGL_LEVEL=0 EGL_LUMINANCE_SIZE=0 EGL_MAX_PBUFFER_WIDTH=8192 EGL_MAX_PBUFFER_HEIGHT=8192 EGL_MAX_PBUFFER_PIXELS=67108864 EGL_MAX_PBUFFER_HEIGHT=8192 EGL_MAX_PBUFFER_HEIGHT=8192 EGL_NATIVE_RENDERABLE=0 EGL_NATIVE_VISUAL_TYPE=4 EGL_RENDERABLE_TYPE=69 EGL_SAMPLE_BUFFERS=0 EGL_SAMPLES=0 EGL_SURFACE_TYPE=5125 EGL_TRANSPARENT_TYPE=12344 EGL_TRANSPARENT_RED_VALUE=0 EGL_TRANSPARENT_GREEN_VALUE=0 EGL_TRANSPARENT_BLUE_VALUE=0
    05-08 14:17:23.264 28146 28204 I yoyo    : Selected EGL config working
    05-08 14:17:23.265 28146 28146 I yoyo    : Resuming the C++ Runner/resetting GL state
    05-08 14:17:23.265 28146 28146 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: ea919e18
    05-08 14:17:23.267 28146 28204 I yoyo    : onSurfaceCreated() aborted on re-create 1, state is currently Process
    05-08 14:17:23.267 28146 28204 I yoyo    : onSurfaceChanged :: width=2560 height=1440
    05-08 14:17:23.272 28146 28146 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: ea919e18
    05-08 14:17:23.664 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:23.687 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:23.730 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:23.734 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:26.690 28146 28204 I yoyo    : Listening for speech
    05-08 14:17:26.781 28146 28146 I yoyo    : onWindowFocusChanged(false|false)
    05-08 14:17:26.785 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:26.785 28146 28146 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: ea919e18
    05-08 14:17:26.806 28146 28146 I yoyo    : onPause
    05-08 14:17:26.807 28146 28204 I yoyo    : send to onActivityResult, Data: Intent { act=android.speech.action.RECOGNIZE_SPEECH launchParam=MultiScreenLaunchParams { mDisplayId=0 mFlags=0 } (has extras) }
    05-08 14:17:26.810 28146 28146 I yoyo    : Pausing the Runner
    05-08 14:17:26.810 28146 28146 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: ea919e18
    05-08 14:17:27.061 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:27.285 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:27.562 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:30.608 28146 28146 I yoyo    : Got activity result: -1
    05-08 14:17:30.611 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:30.611 28146 28146 I yoyo    : End Got activity result
    05-08 14:17:30.615 28146 28146 I yoyo    : onResume
    05-08 14:17:30.643 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:30.696 28146 28146 I yoyo    : onWindowFocusChanged(true|false)
    05-08 14:17:30.697 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:30.697 28146 28146 I yoyo    : resumeApp
    05-08 14:17:30.710 28146 28146 I yoyo    : GAMEPAD: Bonded Bluetooth devices read
    05-08 14:17:30.716 28146 28146 D yoyo    : ****** Found API level 12 function! Joysticks supported
    05-08 14:17:30.720 28146 28146 I yoyo    : GAMEPAD: Enumeration complete
    05-08 14:17:30.720 28146 28204 I yoyo    : chooseConfig
    05-08 14:17:30.735 28146 28204 I yoyo    : OpenGL ES Extensions : GL_EXT_debug_marker GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth24 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_OES_EGL_sync GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_required_internalformat GL_OES_vertex_array_object GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_type_2_10_10_10_REV GL_OES_fbo_render_mipmap GL_OES_element_index_uint GL_EXT_shadow_samplers GL_OES_texture_compression_astc GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_KHR_texture_compression_astc_sliced_3d GL_KHR_debug GL_EXT_occlusion_query_boolean GL_EXT_disjoint_timer_query GL_EXT_blend_minmax GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_OES_texture_3D GL_EXT_texture_storage GL_EXT_multisampled_render_to_texture GL_OES_surfaceless_context GL_OES_texture_stencil8 GL_EXT_shader_pixel_local_storage GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_ARM_mali_program_binary GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_RG8 GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OES_texture_storage_multisample_2d_array GL_OES_shader_image_atomic GL_EXT_robustness GL_EXT_draw_buffers_indexed GL_OES_draw_buffers_indexed GL_EXT_texture_border_clamp GL_OES_texture_border_clamp GL_EXT_texture_cube_map_array GL_OES_texture_cube_map_array GL_OES_sample_variables GL_OES_sample_shading GL_OES_shader_multisample_interpolation GL_EXT_shader_io_blocks GL_OES_shader_io_blocks GL_EXT_tessellation_shader GL_OES_tessellation_shader GL_EXT_primitive_bounding_box GL_OES_primitive_bounding_box GL_EXT_geometry_shader GL_OES_geometry_shader GL_ANDROID_extension_pack_es31a GL_EXT_gpu_shader5 GL_OES_gpu_shader5 GL_EXT_texture_buffer GL_OES_texture_buffer GL_EXT_copy_image GL_OES_copy_image GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float GL_EXT_YUV_target GL_OVR_multiview GL_OVR_multiview2 GL_OVR_multiview_multisampled_render_to_texture GL_KHR_robustness GL_KHR_robust_buffer_access_behavior GL_EXT_draw_elements_base_vertex GL_OES_draw_elements_base_vertex GL_EXT_protected_textures
    05-08 14:17:30.735 28146 28204 I yoyo    : Device supports 32bit display formats
    05-08 14:17:30.736 28146 28204 I yoyo    : 16 bit colour depth forced
    05-08 14:17:30.737 28146 28204 I yoyo    : Trying EGL config : EGLConfig 7: rgba=5650 depth=24 stencil=8 EGL_ALPHA_MASK_SIZE=0 EGL_BUFFER_SIZE=16 EGL_COLOR_BUFFER_TYPE=12430 EGL_CONFIG_CAVEAT=0x3038 EGL_LEVEL=0 EGL_LUMINANCE_SIZE=0 EGL_MAX_PBUFFER_WIDTH=8192 EGL_MAX_PBUFFER_HEIGHT=8192 EGL_MAX_PBUFFER_PIXELS=67108864 EGL_MAX_PBUFFER_HEIGHT=8192 EGL_MAX_PBUFFER_HEIGHT=8192 EGL_NATIVE_RENDERABLE=0 EGL_NATIVE_VISUAL_TYPE=4 EGL_RENDERABLE_TYPE=69 EGL_SAMPLE_BUFFERS=0 EGL_SAMPLES=0 EGL_SURFACE_TYPE=5125 EGL_TRANSPARENT_TYPE=12344 EGL_TRANSPARENT_RED_VALUE=0 EGL_TRANSPARENT_GREEN_VALUE=0 EGL_TRANSPARENT_BLUE_VALUE=0
    05-08 14:17:30.738 28146 28204 I yoyo    : Selected EGL config working
    05-08 14:17:30.739 28146 28146 I yoyo    : Resuming the C++ Runner/resetting GL state
    05-08 14:17:30.739 28146 28146 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: ea919e18
    05-08 14:17:30.741 28146 28204 I yoyo    : onSurfaceCreated() aborted on re-create 1, state is currently Process
    05-08 14:17:30.741 28146 28204 I yoyo    : onSurfaceChanged :: width=2560 height=1440
    05-08 14:17:30.748 28146 28146 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: ea919e18
    05-08 14:17:30.768 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:31.112 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:31.144 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:31.198 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:31.269 28146 28146 I yoyo    : Setting vis flags to 5894
    05-08 14:17:31.708 28146 28204 I yoyo    : Spoken words-
    05-08 14:17:31.708 28146 28204 I yoyo    :
     
    Last edited: May 8, 2017
  2. Wraithious

    Wraithious Member

    Joined:
    Jun 24, 2016
    Posts:
    1,166
    It would probably be easier if you see the project to help, please pm me and I will send you the gmz
     
  3. Wraithious

    Wraithious Member

    Joined:
    Jun 24, 2016
    Posts:
    1,166
    So I've been at this for a long time with no luck, The problem definatly is that all resulting data from the intent is being deleted after notifying the runner that it got results from the activity, therefor not firing off the onActivityResult method, but why? and how do I fix it? here's a detailed image explanation of what exactly is happening:
    ttsproblem.png

    Here is my Android apk so you can see what is going on, and to show that my intents are working, even intents that include extra data such as the set alarm intent, try this test, press enter text button and type- set alarm at 10:00
    it will set your alarm and show a toast that it is set. here is the readme file for the example project:
    EXTENSION SPECIFIC INFO:
    Functions-
    1. getMic()- activates speech input.
    2. endSession()- shuts down TTS. make sure to call this before ending game!
    3. talk()- ciri speaks whatever text you input.
    4. remember(String)- speak or enter the text "remember this" + key words to recognize later.
    5. searchMemory(string)- activated by saying or entering remember this, she'll say "what should I say?" so say or enter text "you should say" + what she should say to the inputted memory you gave her in the remember function.
    6. resetNewMemories()- deletes all new memory and new search memory.
    7. SstTtsInit()- call once to start text to speech, only call again if you've called endSession() and want to restart text to speech.
    8. canTalk()- check weather text to speech is initialized.
    9. recognition(String)- use to interact with ciri, if she recognizes a word or group of words she will respond, default things you can say:
    hello
    what is your name
    what time is it
    military time
    regular time
    wake me up at
    set alarm at
    what is my name
    how old am I
    10. changeLang(String)- change the default language, string can be "usa", "canada", "germany", "italy", "japan" or "china".
    11-14. Next 4 functions are for getting app permissions in android m, must be called in create event of first run object in first room of game.
    15. findMySpeech()- gets text from what you last spoke into the mic and sends it to the recognition method.
    16. timeType(String)- String must include either "military time" or "regular time" and toggles 12 and 24 hour format.

    Social async types:
    NOTE all values are returned as strings
    1. initted- Query weather TTS is running.
    2. whostalking- Returns "2" when ciri starts speaking.
    3. compsays- Converts Ciri's spoken words to text.
    4. yousaid- Converts your spoken words to text.
    5. addedMemories- Gets index number for each new memory and response combination when speech from user includes "you should say" + string of what she should say.

    NON - EXTENSION SPECIFIC INFO:
    Dialog async ids triggered from GMS function get_string_async:
    1. textme- gets speech from text input as a string.
    sets global.wastyped to text input string.
    2. chanlan- sends typed text string to function changelang for changing language preference, see function 10 description for more info.

    How to use this example project:
    1. Press power button to start or stop text to speech session.
    2. press input text to enter text to hear ciri's responses.
    3. press change language to change language to usa, canada, german, japan or china.
    tap the microphone to speak to ciri.
    ttsproblem2.png
     
    Last edited: May 13, 2017
  4. lolslayer

    lolslayer Member

    Joined:
    Jun 23, 2016
    Posts:
    671
    I don't like the fact that nobody responded to you, but I just want to give a short explenation of the reason I've heard that nobody answered.

    Not enough people here have experience with extensions and the ones that do probably didn't see the post as of yet.

    Just so you know. :)
     
  5. Wraithious

    Wraithious Member

    Joined:
    Jun 24, 2016
    Posts:
    1,166
    Thanks I appreciate it, I had them move this topic over from the general programming help cuz I thought this would be a better place for it, extension making is definitely not easy, also I was hoping if the members here wouldnt be able to help that maybe one of the yoyo staff would know and would see this post and send me in the right direction to solve this, its definatly an issue with the runner being paused then when the resume app is called the intent data is lost to the garbage collector before onActivityResult is called, I just need to know how to catch it before that happens
     
  6. Wraithious

    Wraithious Member

    Joined:
    Jun 24, 2016
    Posts:
    1,166
    Update, I ended up filing a bug report about this and it is being looked into, I'll post another update when I hear further news back from them, thanks @yoyo games devs!
     
    Nocturne likes this.
  7. lolslayer

    lolslayer Member

    Joined:
    Jun 23, 2016
    Posts:
    671
    No problem man ;)
     
    Wraithious likes this.
  8. Wraithious

    Wraithious Member

    Joined:
    Jun 24, 2016
    Posts:
    1,166
    So it's been awhile since I submitted the bug report about the garbage collector deleting the recognizerIntent's data before onActivityResult gets called, my initial response from @Stewart and mantis affirmed it as a bug then told me i would not be able to follow up on the investigation progress, I emailed them back a while after with no response, then again over a week ago using the follow up bug report contact, still no response, @Mike or anyone else who may know, is there any progress with this? Does the garbage collector have this same bug in GMS 2 as well? My bug tracking ticket number is: 127222
    I have made an app in android studio that uses the speech recognition feature and successfully uploaded it to google play, and I have a basic extension for only text to speech on the yoyo games marketplace now that works in both GMS 1-2 but but I would really like to get it to work as a text to speech and speech to text extension to upload to the marketplace as it would work with both GMS1.3+ and GMS2 and I'm sure it's something the community would want to use. I would just like to know if this bug will or will not be fixed, thanks

    So, @rwkay or @Mike or any moderators can you please help with this question?
     
    Last edited: Jul 21, 2017
  9. Wraithious

    Wraithious Member

    Joined:
    Jun 24, 2016
    Posts:
    1,166
    cricket cricket... lol
     
  10. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,033
    Would it be possible to launch a dummy activity that you do have control over (as opposed to the runner which you don't), then use that dummy activity to launch the recording activity and get its result? If the dormancy of the main runner activity is the problem, then this might be a way around it.

    Though I don't have Android extension experience, I've had to create similar "middleman" shims for HTML5 extensions when its callback mechanism went haywire, so I can somewhat relate to this.
     
    Wraithious likes this.
  11. Wraithious

    Wraithious Member

    Joined:
    Jun 24, 2016
    Posts:
    1,166
    That's a good idea, I can try it out and see, maybe if I unattatch the jni runner from the recognizer intent by calling a function that just starts a method that then starts another method internally in my java script that will start the speech recognition intent, it may work thanks!
     
  12. Wraithious

    Wraithious Member

    Joined:
    Jun 24, 2016
    Posts:
    1,166
    Hi @FrostyCat , so unfortunately I had no luck trying to fool GMS, I tried adding a method that runs a while loop, that just seized up the game, so I used a for loop, that didn't seize the game and the for loop ran (I set it to 100000000 to give it time) but that didn't work either, I tried removing the runner from the intent, that didn't work, tried removing the runner from the onActivityResult, also didn't work, it's definitely the gms runner sending the data to the garbage collector before onActivityResult can get it, so basically the data is getting deleted between this method which does definatly run:
    Code:
        public void getMic() {
        editor.putString("spoken", "No words spoken yet").commit();
        Log.i("yoyo", "Starting speech recognition");
                k = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
                k.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
                k.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
                k.putExtra(RecognizerIntent.EXTRA_PROMPT, "Say something");
            try {
                (RunnerActivity.CurrentActivity).startActivityForResult(k, EVENT_RECOGNIZED);
                Log.i("yoyo", "send to onActivityResult, Intent bundle: " + String.valueOf(k));
            } catch (ActivityNotFoundException a) {
                Log.i("yoyo", "Your device doesn't support Speech Recognition");
            }
        }
    and this method that apparently never gets called:
    Code:
        @Override
        protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == EVENT_RECOGNIZED) {
            if (resultCode == RESULT_OK) {
                ArrayList<String> res = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
                String holdForGMS = String.valueOf(res.get(0));
                editor.putString("spoken", holdForGMS).commit();
                ReturnGMS("yousaid", holdForGMS);           
                }
            }
        }
    so between and inside those 2 methods I tried all the things I mentioned above, So I really wish @Mike or @rwkay or someone involved with gamemaker would help me out with this, I have read threads on the forum about the ability to disable the garbage collector in GMS:2, if this is true maybe my extension will work in GMS2, and maybe before they get rid of updating GMS1x they could fix it or implement disabling the garbage collector, if even that is the the case, if you or someone would like to try it in GMS2 with the garbage collector turned off that would settle this whole matter, just let me know if you want to try it and I'll pm you the link.
     
  13. Mike

    Mike nobody important GMC Elder

    Joined:
    Apr 12, 2016
    Posts:
    2,288
    This issue has been bugged I believe, so some one will take a look when we have time to do so. Sorry we can't be any more precise than that right now, but we are aware of the issue you've filed.
     
  14. Wraithious

    Wraithious Member

    Joined:
    Jun 24, 2016
    Posts:
    1,166
    Ok thanks for the info, I'll put this project on hold for now and work on something new, thanks again
     
  15. Wraithious

    Wraithious Member

    Joined:
    Jun 24, 2016
    Posts:
    1,166
    So I've noticed that @Kaguva got the speach to text java function to work in a gamemaker extension, anyone care to elaborate on that? Has the bug been fixed? If so It would of been nice if someone notified me from my bug report i filed A YEAR AGO, so what ended up solving this I really want to know.....
     
  16. JesterOC

    JesterOC Member

    Joined:
    Jun 27, 2016
    Posts:
    23
    This totally sucks... the bug, and the lack of support...
    I've not yet bought android module for GMS2, so idk if it fixes this problem...
    DOES ANYONE KNOW IF THIS IS FIXED UP IN GMS2...???
    • I am having this problem right, was trying to use " Intent.ACTION_OPEN_DOCUMENT_TREE "
    • Now using " Intent.ACTION_OPEN_DOCUMENT "
    • I just got the File Browsing bit to pop up a few hours ago....
    • I get -1 returned in the console from RunnerActivity's onActivityResult when i select a file... (The data is there too :) )
    • I get 0 returned in the console if i cancel...
    • I don't get any of my code to run in my java extension's onActivityResult...
    • It's been > 8 hours trying to get this working :'(

      I have a solution... but requires modding RunnerActivity :(

     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice