Krush on sound recording.



  • I'm building an application for sound recording, all by example, an app is crumbling, and I think it's because I don't get a license on the LADIO. Here's the manifesto file.

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="michael.audio">
    

    <uses-permission android:name="android.permission.RECORD_AUDIO" ></uses-permission>
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    <application android:allowBackup="true"

    android:label="@string/app_name"
    android:icon="@mipmap/ic_launcher"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"&gt;
    
    &lt;activity android:name=".mainAct"
            android:label="@string/app_name"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN"/&gt;
                &lt;category android:name="android.intent.category.LAUNCHER"/&gt;
            &lt;/intent-filter&gt;
    &lt;/activity&gt;
    

    </application>

    And the app's mistakes, they're just because the application doesn't request a sound recording permit.

    12-04 01:59:25.784 20512-20512/? E/AudioRecord: AudioFlinger could not          create record track, status: -1
    12-04 01:59:25.786 20512-20512/? E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -1.
    12-04 01:59:25.786 20512-20512/? E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.



  • It was easier and less obvious. Starting with the sixth version of worms androids in the code, there is a clear need to request authorizations, such as:

    ActivityCompat.requestPermissions(thisActivity,
                new String[]{Manifest.permission.RECORD_AUDIO},
                MY_PERMISSIONS_REQUEST_RECORD);
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2