AudioRecord:Android 录音实现

上传者: 42151036 | 上传时间: 2021-05-30 23:51:47 | 文件大小: 3.38MB | 文件类型: ZIP
一、简述 项目中需要实现聊天录音的功能,搜集资料实现初步功能之后,在这里统一整理一下。 Android提供了两个API用于录音的实现:MediaRecorder 和AudioRecord。 1、MediaRecorder:录制的音频文件是经过压缩后的,需要设置编码器。并且录制的音频文件可以用系统自带的Music播放器播放。MediaRecorder已经集成了录音、编码、压缩等,并支持少量的录音音频格式,但是这也是他的缺点,支持的格式过少并且无法实时处理音频数据。 2、AudioRecord:主要实现对音频实时处理以及边录边播功能,相对MediaRecorder比较专业,输出是PCM语音数据,如果保存成音频文件,是不能够被播放器播放的,所以必须先写代码实现数据编码以及压缩。 MediaRecorder MediaRecorder因为已经集成了录音、编码、压缩等功能,所以使用起来相对比较简单。

文件下载

资源详情

[{"title":"( 87 个子文件 3.38MB ) AudioRecord:Android 录音实现","children":[{"title":"AudioRecord-master","children":[{"title":"gradlew.bat <span style='color:#111;'> 2.26KB </span>","children":null,"spread":false},{"title":"gradlew <span style='color:#111;'> 4.85KB </span>","children":null,"spread":false},{"title":"gradle.properties <span style='color:#111;'> 730B </span>","children":null,"spread":false},{"title":"screenshots","children":[{"title":"01.gif <span style='color:#111;'> 1.78MB </span>","children":null,"spread":false}],"spread":true},{"title":"library","children":[{"title":"proguard-rules.pro <span style='color:#111;'> 930B </span>","children":null,"spread":false},{"title":"src","children":[{"title":"test","children":[{"title":"java","children":[{"title":"com","children":[{"title":"af","children":[{"title":"ExampleUnitTest.java <span style='color:#111;'> 384B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"androidTest","children":[{"title":"java","children":[{"title":"com","children":[{"title":"af","children":[{"title":"ExampleInstrumentedTest.java <span style='color:#111;'> 722B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"main","children":[{"title":"res","children":[{"title":"values","children":[{"title":"strings.xml <span style='color:#111;'> 70B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"java","children":[{"title":"com","children":[{"title":"af","children":[{"title":"audio","children":[{"title":"IAudioState.java <span style='color:#111;'> 177B </span>","children":null,"spread":false},{"title":"AudioRecordManager.java <span style='color:#111;'> 20.49KB </span>","children":null,"spread":false},{"title":"IAudioRecordEvent.java <span style='color:#111;'> 644B </span>","children":null,"spread":false},{"title":"AudioPlayManager.java <span style='color:#111;'> 10.35KB </span>","children":null,"spread":false},{"title":"IAudioPlayListener.java <span style='color:#111;'> 175B </span>","children":null,"spread":false},{"title":"IAudioRecordListener.java <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":"AudioStateMessage.java <span style='color:#111;'> 236B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true},{"title":"AndroidManifest.xml <span style='color:#111;'> 281B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".gitignore <span style='color:#111;'> 7B </span>","children":null,"spread":false},{"title":"build.gradle <span style='color:#111;'> 4.03KB </span>","children":null,"spread":false}],"spread":true},{"title":"app","children":[{"title":"proguard-rules.pro <span style='color:#111;'> 930B </span>","children":null,"spread":false},{"title":"src","children":[{"title":"test","children":[{"title":"java","children":[{"title":"com","children":[{"title":"af","children":[{"title":"ExampleUnitTest.java <span style='color:#111;'> 384B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"androidTest","children":[{"title":"java","children":[{"title":"com","children":[{"title":"af","children":[{"title":"ExampleInstrumentedTest.java <span style='color:#111;'> 717B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"main","children":[{"title":"res","children":[{"title":"mipmap-xxxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 10.24KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 14.35KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable","children":[{"title":"community_btn_chat_press_normal.xml <span style='color:#111;'> 307B </span>","children":null,"spread":false},{"title":"community_btn_chat_press_say.xml <span style='color:#111;'> 294B </span>","children":null,"spread":false},{"title":"community_bg_pop_record_voice.xml <span style='color:#111;'> 223B </span>","children":null,"spread":false},{"title":"community_chat_voice_play_anim_right.xml <span style='color:#111;'> 474B </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-xxhdpi","children":[{"title":"background_chat_right_02.9.png <span style='color:#111;'> 3.36KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-hdpi","children":[{"title":"default_header.jpg <span style='color:#111;'> 48.34KB </span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'> 3.34KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 4.11KB </span>","children":null,"spread":false}],"spread":false},{"title":"values","children":[{"title":"colors.xml <span style='color:#111;'> 208B </span>","children":null,"spread":false},{"title":"strings.xml <span style='color:#111;'> 438B </span>","children":null,"spread":false},{"title":"attrs.xml <span style='color:#111;'> 366B </span>","children":null,"spread":false},{"title":"styles.xml <span style='color:#111;'> 383B </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xxhdpi","children":[{"title":"community_record_volume_02.png <span style='color:#111;'> 455B </span>","children":null,"spread":false},{"title":"community_record_volume_03.png <span style='color:#111;'> 544B </span>","children":null,"spread":false},{"title":"community_record_volume_05.png <span style='color:#111;'> 866B </span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'> 7.54KB </span>","children":null,"spread":false},{"title":"community_record_volume_04.png <span style='color:#111;'> 798B </span>","children":null,"spread":false},{"title":"community_voice_right_03.png <span style='color:#111;'> 1.89KB </span>","children":null,"spread":false},{"title":"community_record_volume_microphone.png <span style='color:#111;'> 5.71KB </span>","children":null,"spread":false},{"title":"community_record_volume_06.png <span style='color:#111;'> 962B </span>","children":null,"spread":false},{"title":"community_record_volume_cancel.png <span style='color:#111;'> 3.50KB </span>","children":null,"spread":false},{"title":"community_circle_court.png <span style='color:#111;'> 4.45KB </span>","children":null,"spread":false},{"title":"community_record_volume_warning.png <span style='color:#111;'> 1.26KB </span>","children":null,"spread":false},{"title":"community_voice_right_02.png <span style='color:#111;'> 1.00KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 9.82KB </span>","children":null,"spread":false},{"title":"community_voice_right_01.png <span style='color:#111;'> 346B </span>","children":null,"spread":false},{"title":"community_record_volume_01.png <span style='color:#111;'> 335B </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 2.15KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 2.50KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 4.73KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 5.97KB </span>","children":null,"spread":false}],"spread":false},{"title":"layout","children":[{"title":"community_pop_record_voice.xml <span style='color:#111;'> 2.36KB </span>","children":null,"spread":false},{"title":"activity_main.xml <span style='color:#111;'> 1000B </span>","children":null,"spread":false},{"title":"community_adapter_chat_list_right_voice.xml <span style='color:#111;'> 2.40KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"java","children":[{"title":"com","children":[{"title":"af","children":[{"title":"audiodemo","children":[{"title":"view","children":[{"title":"VideoAdapter.java <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"MainActivity.java <span style='color:#111;'> 4.43KB </span>","children":null,"spread":false},{"title":"RecordVoicePopWindow.java <span style='color:#111;'> 4.37KB </span>","children":null,"spread":false},{"title":"widget","children":[{"title":"VoiceImageView.java <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false},{"title":"CircleImageView.java <span style='color:#111;'> 10.04KB </span>","children":null,"spread":false},{"title":"RecordAudioButton.java <span style='color:#111;'> 3.39KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"MainContract.java <span style='color:#111;'> 1.64KB </span>","children":null,"spread":false},{"title":"MainPresenter.java <span style='color:#111;'> 4.44KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":true},{"title":"AndroidManifest.xml <span style='color:#111;'> 912B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".gitignore <span style='color:#111;'> 7B </span>","children":null,"spread":false},{"title":"build.gradle <span style='color:#111;'> 1.08KB </span>","children":null,"spread":false}],"spread":true},{"title":"gradle","children":[{"title":"wrapper","children":[{"title":"gradle-wrapper.jar <span style='color:#111;'> 52.38KB </span>","children":null,"spread":false},{"title":"gradle-wrapper.properties <span style='color:#111;'> 233B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".idea","children":[{"title":"caches","children":[{"title":"build_file_checksums.ser <span style='color:#111;'> 610B </span>","children":null,"spread":false}],"spread":true},{"title":"codeStyles","children":[{"title":"Project.xml <span style='color:#111;'> 3.23KB </span>","children":null,"spread":false}],"spread":true},{"title":"gradle.xml <span style='color:#111;'> 801B </span>","children":null,"spread":false},{"title":"runConfigurations.xml <span style='color:#111;'> 564B </span>","children":null,"spread":false},{"title":"misc.xml <span style='color:#111;'> 3.80KB </span>","children":null,"spread":false},{"title":"vcs.xml <span style='color:#111;'> 180B </span>","children":null,"spread":false},{"title":"copyright","children":[{"title":"profiles_settings.xml <span style='color:#111;'> 74B </span>","children":null,"spread":false}],"spread":false},{"title":"modules.xml <span style='color:#111;'> 937B </span>","children":null,"spread":false},{"title":"encodings.xml <span style='color:#111;'> 159B </span>","children":null,"spread":false},{"title":"compiler.xml <span style='color:#111;'> 686B </span>","children":null,"spread":false},{"title":"markdown-navigator-enh.xml <span style='color:#111;'> 4.39KB </span>","children":null,"spread":false},{"title":"markdown-navigator.xml <span style='color:#111;'> 3.09KB </span>","children":null,"spread":false}],"spread":false},{"title":".gitignore <span style='color:#111;'> 125B </span>","children":null,"spread":false},{"title":"app-debug.apk <span style='color:#111;'> 1.77MB </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 4.39KB </span>","children":null,"spread":false},{"title":"settings.gradle <span style='color:#111;'> 27B </span>","children":null,"spread":false},{"title":"build.gradle <span style='color:#111;'> 764B </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明