xiangyuecn / Recorder

html5 js 录音 mp3 wav ogg webm amr g711a g711u 格式,支持pc和Android、iOS部分浏览器、Hybrid App(提供Android iOS App源码)、微信,提供ASR语音识别转文字 H5版语音通话聊天示例 DTMF编码解码
https://xiangyuecn.github.io/Recorder/
MIT License
4.73k stars 1.03k forks source link

Can someone help me translate the README to English? #125

Open mehmetron opened 3 years ago

mehmetron commented 3 years ago

I don't know Chinese but I can proofread and edit the translation after the fact

DeeCen commented 2 years ago

translation by https://fanyi.baidu.com/translate#zh/en/

【源GitHub仓库】 | 【Gitee镜像库】 如果本文档图片没有显示,请手动切换到Gitee镜像库阅读文档。 [GitHub Code link] | [Gitee Code link] view https://gitee.com/xiangyuecn/Recorder when the pictures is not displayed

📖Recorder用于html5录音 📖 Recorder is a javascript library for HTML5 recording

​支持在大部分已实现getUserMedia的移动端、PC端浏览器麦克风录音、实时处理,主要包括:Chrome、Firefox、Safari、IOS 14.3+、Android WebView、腾讯Android X5内核(QQ、微信)、大部分2021年后更新的Android手机自带浏览器;不支持:UC系内核(典型的支付宝),大部分未更新的老旧国产手机自带浏览器,低版本IOS(11.0-14.2)上除Safari外的其他任何形式的浏览器(含PWA、WebClip、任何App内网页)。 Support: more mobile and PC browser with getUserMedia API, including Chrome, Firefox, Safari, IOS 14.3+, Android WebView, Tencent Android X5 core (QQ, WeChat), most Android phones browsers updated after 2021;

Not supported: UC browser (typical Alipay). most of the old version browser phones(MADE IN CHINA). any browser in IOS version<=14.2(11.0-14.2) including PWA, WebClip, any web page in App, except Safari.

支持对任意MediaStream进行音频录制、实时处理,包括:getUserMedia返回的流、WebRTC中的remote流、audio、video标签的captureStream方法返回的流、自己创建的流 等等。 Supports audio recording and real-time processing, including: streams returned by getUserMedia, remote streams in WebRTC, streams returned by captureStream methods of audio and video tags, streams created by yourself, ...

提供多个扩展功能支持:拥有丰富的音频可视化、变速变调处理、音频流播放等;搭配上强大的实时处理支持,可用于各种网页应用:从简单的录音,到复杂的实时语音识别(ASR),甚至音频相关的游戏,都能从容应对。 extensions: audio visualization speed variations audio streaming

It's a powerful library can used in real-time processing, web applications, simple recording, real-time speech recognition (ASR) and games.

音频文件的播放:可直接使用常规的Audio HTML标签来播放完整的音频文件,参考文档下面的【快速使用】部分,有播放例子;上传了的录音直接将音频链接赋值给audio.src即可播放;本地的blob音频文件可通过URL.createObjectURL来生成本地链接赋值给audio.src即可播放,或者将blob对象直接赋值给audio.srcObject(兼容性没有src高) Playback: it can be Playback with HTML tags: <Audio src=(window.URL||webkitURL).createObjectURL( blobFromRecorderStopCallback ); /> (suggest) or audioObj.srcObject = blobFromRecorderStopCallback

实时的音频片段文件播放,可以使用本库自带的BufferStreamPlayer扩展来播放,简单高效,或者采用别的途径播放。 Real-time audio playback can be played using the BufferStreamPlayer extension, or it can be played in your ways.

( Recorder H5 : [ H5在线测试 ] [ H5 QuickStart ] [ H5 vue ] Recorder H5: [H5 Online Test] [H5 QuickStart] [H5 Vue]

工具集 : [ Recorder代码运行和静态分发 ] [ 裸(RAW、WAV)PCM转WAV播放测试和转码 ] [ 无用户操作测试 ] [ Can I Use查看浏览器支持情况 ] Toolset: [Recorder Code Running and Static Distribution] [Bare (RAW, WAV) PCM to WAV Playback Test and Transcoding] [No User Operations Test] [Can I User View Browser Support]

RecordApp[即将废弃] : [ RecordApp测试 ] [ App QuickStart ] [ App vue ] [ Android、IOS App源码 ] RecordApp [Deprecated]: [RecordApp Test] [App QuickStart] [App Vue] [Android, IOS App Source]

录音默认输出mp3格式,另外可选wav、pcm格式;有限支持ogg(beta)、webm(beta)、amr(beta)格式;支持任意格式扩展(前提有相应编码器)。 The default output MP3 format for recording, and wav, PCM format are optional. Limited support for Ogg (beta), WebM (beta), AMR (beta) formats; Supports any format extension (with the corresponding encoder).

mp3默认16kbps的比特率,2kb每秒的录音大小,音质还可以(如果使用8kbps可达到1kb每秒,不过音质太渣)。主要用于语音录制,双声道语音没有意义,特意仅对单声道进行支持。mp3、wav、pcm格式支持边录边转码,录音结束时转码速度极快,支持实时转码成小片段文件和实时传输,demo中已实现一个语音通话聊天,下面有介绍;其他格式录音结束时可能需要花费比较长的时间进行转码。 Mp3 defaults to 16 Kbps bit rate, 2 kb per second recording size, and sound quality is okay (1 KB per second with 8 kbps, but the sound quality is too bad). Mainly used for voice recording, two-channel voice is meaningless, intentionally supporting only one channel. Mp3, wav, PCM formats support transcoding while recording. Transcoding speed is very fast at the end of recording. They support real-time transcoding into small files and real-time transmission. A voice call chat has been implemented in demo, which is described below. Other formats may take a longer time to transcode at the end of the recording.

mp3使用lamejs编码(CBR),压缩后的recorder.mp3.min.js文件150kb左右(开启gzip后54kb)。如果对录音文件大小没有特别要求,可以仅仅使用录音核心+wav编码器(raw pcm format录音文件超大),压缩后的recorder.wav.min.js不足12kb。录音得到的mp3(CBR)、wav(PCM),均可简单拼接小的二进制录音片段文件来生成长的音频文件,具体参考下面这两种编码器的详细介绍。 Mp3 uses lamejs encoding (CBR), a compressed recorder.Mp3.min.js file is about 150 KB (54 KB after opening gzip). If there is no specific requirement for the size of the recording file, you can simply use the recorder core + wav encoder (raw PCM format recording file is too large), compressed recorder.Wav.Min.js is less than 12 kb. The recorded MP3 (CBR) and wav (PCM) can be simply stitched together into a small binary audio fragment file can merge to a long audio file. view the description of the two encoders for more detailes.

如需在Hybrid App内使用(支持IOS、Android),或提供低版本IOS微信的支持,请参阅下面的App中录音示例,参考示例代码给网页授予录音权限,或直接由App底层提供接口给H5调用(app-support-sample目录内有源码)。

For use whit Hybrid App (supports IOS, Android), or support of lower versions of IOS WeChat, see the recording examples in App below, read the sample code to grant recording rights in web pages, or providing interfaces from the App bottom to H5 calls (source code in the app-support-sample directory).

低版本IOS兼容、老旧国产手机自带浏览器上的使用限制等问题和兼容请参阅下面的知识库部分;打开录音后对音频播放的影响、录音中途来电话等问题也参阅下面的知识库。 Problems such as compatibility with lower version IOS, limitations on used in older version phones browsers(made-in-china), and compatibility can be found in the information section. Questions such as the effect of opening a recording on audio playback, the calling during recording etc.

( Demo片段列表 Demo List

【Demo库】【格式转换】-mp3格式转成其他格式 Demo Library Format Conversion - MP3 Format to Other Formats

【Demo库】【格式转换】-wav格式转成其他格式 [Demo Library] [Format Conversion]-wav format to other formats

【Demo库】【格式转换】-amr格式转成其他格式 [Demo Library] [Format Conversion]-amr format to other formats

【教程】【音频流】实时转码并上传-通用版 [Tutorial] [Audio Stream] Real-time transcode and upload - Universal

【教程】【音频流】实时转码并上传-mp3专版 [Tutorial] [Audio Stream] Real-time transcode and upload-mp3 Special Edition

【教程】【音频流】实时解码播放音频片段 [Tutorial]Audio Stream]Decode and play audio clips in real time

【教程】实时录制处理audio、video标签的captureStream流 [Tutorial] Real-time recording handles captureStream streams with audio and Video Tags

【Demo库】【文件合并】-mp3多个片段文件合并 [Demo Library]File Merge-mp3 Fragment File Merge

【Demo库】【文件合并】-wav多个片段文件合并 Demo Library File Merge-wav Multiple Fragment File Merge

【教程】实时多路音频混音 [Tutorial] Real-time multichannel audio mixing

【教程】变速变调音频转换 [Tutorial] Variable Speed Variable Tone Audio Conversion

【教程】新录音从老录音接续、或录制中途插入音频 [Tutorial] New recordings follow from old recordings or insert audio halfway through recordings

【教程】DTMF(电话拨号按键信号)解码、编码 Decoding and Encoding DTMF (Telephone Dial Key Signal)

【Demo库】PCM采样率提升 [Demo Library] PCM sampling rate increase

【测试】音频可视化相关扩展测试 [Test] Audio Visualization Related Extended Test

App Demo App Demo

Android Demo App : 下载APK(40kb,删除.zip后缀, 源码) Android Demo App: Download APK (40kb, delete.Zip suffix, source code)

IOS Demo App :下载源码 自行编译 IOS Demo App: Download the source code and compile it yourself

小程序WebView wechat miniapp WebView

使用到这个库用于祝福语音的录制,已开通网页版和微信小程序版。专门针对IOS的微信中进行了兼容处理,IOS上微信环境中调用的微信的api(小程序、公众号api)。小程序地址:;网页地址: Use this library for recording voices of wishes. Web page and WeChat miniapp versions are available. Compatibility processing has been done for IOS-specific microcomputers, the API (applet, public number api) of the microcomputers invoked in the WeChat environment on IOS. miniapp address: Web page address:

如果你的项目用到了这个库也想展示到这里,可以发个isuse,注明使用介绍和访问方式,我们收录在这里。 If this library is used by your project and you want to show it here, post a new isuse.(show the library codes, a link is welcome)