本文整理汇总了Java中ee.ioc.phon.android.speechutils.RawAudioRecorder类的典型用法代码示例。如果您正苦于以下问题:Java RawAudioRecorder类的具体用法?Java RawAudioRecorder怎么用?Java RawAudioRecorder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RawAudioRecorder类属于ee.ioc.phon.android.speechutils包,在下文中一共展示了RawAudioRecorder类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAudioRecorder
import ee.ioc.phon.android.speechutils.RawAudioRecorder; //导入依赖的package包/类
/**
* Constructs a recorder based on the encoder type and sample rate. By default returns the raw
* audio recorder. If an unsupported encoder is specified then throws an exception.
*/
protected static AudioRecorder createAudioRecorder(String encoderType, int sampleRate) throws IOException {
// TODO: take from an enum
if ("audio/x-flac".equals(encoderType)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
return new EncodedAudioRecorder(sampleRate);
}
throw new IOException(encoderType + " not supported");
}
return new RawAudioRecorder(sampleRate);
}