Empty microphone data using Crosswalk in Ionic 2 application
Asked Answered
N

1

8

In my Ionic 2 application, I use the WebAudio API to record audio (based on https://github.com/mattdiamond/Recorderjs). This is working on Chrome and, after putting the right permissions in AndroidManifest.xml:

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

and requesting microphone access through the cordova.plugins.diagnostic plugin, on Android version 6.0.1 (Samsung Galaxy S6).

However, it doesn't work on Android 4.2.2 (Samsung Galaxy S4) because it doesn't seem to support getUserMedia, so I decided to install the crosswalk plugin:

ionic plugin add cordova-plugin-crosswalk-webview

After that I see getUserMedia can be used (through a Modernizr check). However, now the audio recorder returns only silence (on both versions of Android). I have checked that the permissions are still set correctly. Any idea what could be wrong?

Nodical answered 4/10, 2016 at 19:38 Comment(0)
N
2

In the end, it seemed to be due to the (stable) version of crosswalk I was using; I fixed it by using the beta release:

ionic plugin add cordova-plugin-crosswalk-webview --variable XWALK_VERSION="org.xwalk:xwalk_core_library_beta:21.51.546.7"

Also see: https://crosswalk-project.org/jira/browse/XWALK-7030

Nodical answered 9/10, 2016 at 14:47 Comment(1)
This fixed the issue, in combination with the RECORD_AUDIO and MODIFY_AUDIO_SETTINGS permissions. Btw, don't forget to request the permissions using the permissions plugin: github.com/NeoLSN/cordova-plugin-android-permissionsRhine

© 2022 - 2024 — McMap. All rights reserved.