Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Not able to create directory with .mp3 file in Android 10 #58

Open
pgandroid1289 opened this issue Apr 22, 2021 · 0 comments
Open

Not able to create directory with .mp3 file in Android 10 #58

pgandroid1289 opened this issue Apr 22, 2021 · 0 comments

Comments

@pgandroid1289
Copy link

pgandroid1289 commented Apr 22, 2021

I m using this call recorder for Android 10. As i saw the issue that it is not working in Android 10. So i have modify the code as per coments.

class MyAccessibilityService : AccessibilityService() {
var mService: Service? = null
override fun onAccessibilityEvent(event: AccessibilityEvent) {}
override fun onInterrupt() {}
override fun onServiceConnected() {}
override fun onCreate() {
    mService = this
}
}

 <service
        android:name="com.services.MyAccessibilityService"
        android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
        <intent-filter android:priority="1000">
            <action android:name="android.accessibilityservice.AccessibilityService" />
        </intent-filter>

        <meta-data
            android:name="android.accessibilityservice"
            android:resource="@xml/accessibility_service_config" />
    </service>

And then i call this code for recording

   private fun startRecording() {
 
   var source = MediaRecorder.AudioSource.VOICE_COMMUNICATION
    if (VERSION.SDK_INT >= 29) source = MediaRecorder.AudioSource.VOICE_RECOGNITION
    callRecord = CallRecord.Builder(this)
        .setRecordFileName("Record")
        .setRecordDirName("Mobile")
        .setRecordDirPath(getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS)!!.absolutePath)
        .setAudioEncoder(MediaRecorder.AudioEncoder.AMR_WB)
        .setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)
        .setAudioSource(source)
        .setLogEnable(true)
        .setShowSeed(true)
        .setShowPhoneNumber(true)
        .build()
    callRecord.startCallReceiver()


    println(" ${callRecord!!.recordDirName}")
    println(" ${callRecord!!.recordFileName}")
    println(" ${callRecord!!.recordDirPath}")

   }

and for stop it,

  private fun stopRecording() {
    callRecord.stopCallReceiver()
  }

But i m not able to see directory in my file manager. So i am not sure that if recording file is storing or not because i m not able to see directory or folder anywhere in my file manager.

So please help me out.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant