使用 AudioRecorder 设置音频格式
我正在运行 Android SDK 2.2 并将 Samsung Galaxy Tab 设置为目标,使用以下代码创建录音机对象,
private static final int AUDIO_BUFFER_SAMPLEREAD_SIZE = 8000;
public int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;
public int audioEncoding = AudioFormat.ENCODING_PCM_8BIT;
创建录音机对象,
bufferbytesize=AudioRecord.getMinBufferSize(samplingRate,channelConfiguration,audioEncoding);
但我总是得到 bufferbytesize 为 -2,这意味着输入格式有问题,我已提供, 这是否意味着,Android 模拟器不支持 8 位 PCM 数据的 8000 采样率,或者是否有任何解决方法可以摆脱它,
I am Running Android SDK, 2.2 and set Samsung Galaxy Tab as target, using following code to create Audio Recorder Object,
private static final int AUDIO_BUFFER_SAMPLEREAD_SIZE = 8000;
public int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;
public int audioEncoding = AudioFormat.ENCODING_PCM_8BIT;
Creating Audio Recorder Object,
bufferbytesize=AudioRecord.getMinBufferSize(samplingRate,channelConfiguration,audioEncoding);
But i am always getting bufferbytesize is -2, which means something wrong with the input format, which i have provided,
Does that mean, on Android Emulator doesn't support 8000 Sampling rate with 8 bit PCM data, or Are there any workaround to get rid out it,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论