Android AudioRecord Supported Sampling Rates

前端 未结 8 692
悲&欢浪女
悲&欢浪女 2020-11-28 22:47

I\'m trying to figure out what sampling rates are supported for phones running Android 2.2 and greater. We\'d like to sample at a rate lower than 44.1kHz and not have to re

8条回答
  •  日久生厌
    2020-11-28 23:11

    I have a phone (Acer Z3) where I get a positive buffer size returned from AudioRecord.getMinBufferSize(...) when testing 11025 Hz. However, if I subsequently run

    audioRecord = new AudioRecord(...);
    int state = audioRecord.getState();
    if (state != AudioRecord.STATE_INITIALIZED) ...
    

    I can see that this sampling rate in fact does not represent a valid configuration (as pointed out by user1222021 on Jun 5 '12). So my solution is to run both tests to find a valid sampling rate.

提交回复
热议问题