ads

mardi 22 septembre 2015

Has anyone successfully record 96000Hz audio after Android 5.0?



Hi,

As the update of Android 5.0 mentioned, it starts supporting audio recording at 96000Hz. However, it doesn't work on my Samsung Galaxy s5 / s6 edge (both are Android 5.0).

I use the following script to test the capability:

Code:


void checkAvailableSampleRate(){
    for (int rate : new int[] {44100, 48000, 96000}) {  // add the rates you wish to check against
        int bufferSize = AudioRecord.getMinBufferSize(rate, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT);
        if (bufferSize > 0) {
            // buffer size is valid, Sample rate supported
            Log.d(C.LOG_TAG,"Sample rate "+rate+" is supportted");
            // just used for debugging
            AudioRecord temp = new AudioRecord(MediaRecorder.AudioSource.MIC, rate, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT, bufferSize);
            Log.d(C.LOG_TAG,"make audioRecord successfully ");
        }
    }
}


My S5 is unable to get minBuffer size when sample rate is set to 96000Hz. My S6 edge is able to do it but unable to create a AudioRecord instance (get error: "java.lang.IllegalArgumentException: 96000Hz is not a supported sample rate.").

This problem is also asked in this forum for Nexus 9 but there is no conclusion. I am wondering if anyone knows which device can support audio recording at 96000Hz or any customized ROM can help me to do it. Thanks!



Aucun commentaire:

Enregistrer un commentaire