2fps / recorder Goto Github PK
View Code? Open in Web Editor NEWhtml5 js 浏览器 web端录音
Home Page: https://recorder.zhuyuntao.cn/
License: MIT License
html5 js 浏览器 web端录音
Home Page: https://recorder.zhuyuntao.cn/
License: MIT License
拿到的pcm数据太大 给如何压缩?按照文档最大的压缩比 1s生成的文件也大概30k左右
直接运行源码会报错
function convertWavToMp3(wavDataView: DataView) {
const wav = lamejs.WavHeader.readHeader(wavDataView);
const samples = new Int16Array(wavDataView.buffer, wav.dataOffset, wav.dataLen / 2);
const { channels, sampleRate } = wav;
const buffer = [];
const mp3enc = new lamejs.Mp3Encoder(channels, sampleRate, 128);
let remaining = samples.length;
const maxSamples = 1152;
for (let i = 0; remaining >= maxSamples; i += maxSamples) {
const mono = samples.subarray(i, i + maxSamples);
const mp3buf = mp3enc.encodeBuffer(mono);
if (mp3buf.length > 0) {
buffer.push(new Int8Array(mp3buf));
}
remaining -= maxSamples;
}
const d = mp3enc.flush();
if (d.length > 0) {
buffer.push(new Int8Array(d));
}
return new Blob(buffer, { type: 'audio/mp3' });
}
Example:
const mp3Blob = convertWavToMp3(recorder.getWAV())
我这边试了下是可以work的
华为荣耀9X,录制的语音播放后,是杂音
通过MediaDevices.getUserMedia()方式获取音视频流后,销毁组件后,浏览器的录音标志一直未消失,Windows会提示该网页的麦克风一直处于监听状态。是否应当在销毁组件后,关闭监听状态?请教一下。
目前在代码里看到playAudio只是创建了音频进行播放,没有走其他的流程,我想请教下,可以得到正在播放的音频的波形信息吗?如果可以,应该是一个怎么样的流程呢
引入webpack打包机制,能够转化高版本es至es5,并支持压缩。
Cannot read property 'close' of undefined
由于目前各家语音识别要求的音频采样率都需要是16K,但是采用16K的采样率去录制的话,音频就会失真,这个问题能解决吗
为什么不支持getWholeData和getNextData了呢?如果想要实现类似的效果,应该怎么做?
在线演示地址https://recorder.zhuyuntao.cn/
在 pc chrome 版本 67.0.3396.79(正式版本) (64 位) 中
无法录音, 日志为: 异常了,NotFoundError:Requested device not found
无法播放pcm文件.日志为
Uncaught Error: EncodingError: Unable to decode audio data /example.js:978:9 Error: EncodingError: Unable to decode audio data at Function../src/recorder.ts.Recorder.throwError (https://recorder.zhuyuntao.cn/example.js:978:15) at AudioContext.<anonymous> (https://recorder.zhuyuntao.cn/example.js:577:22)
前一次录音会略微残留到下一次录音中,怀疑audioprocess需要到4096才触发,前次未满4096的数据会残留在缓存中,待下次触发,则出现前次音频,不过disconnect后并未释放数据,待处理。。
你好,我用ESP32 做了个HTML5的网站,用于传出麦克风信息. 目前还有BUG, 邀请你一块参与. 这是树莓派做智能音箱的一个扩展项目, 我对网页传声音不太熟悉,看能否帮助指导下 https://github.com/lixy123/ESP32_Remote_MIC
start开始录音的时候,获取波形数据,数组里全是128,怎么根据声音高低来得到对的数据绘制出来
play的时候,getPlayAnalyseData返回的也全是128,显示的波形是一条横线
你好涛老师:
我在使用next.js对seo架构使用您的模块包发现会报错window,document is not defined,这是基于seo架构一开始渲染时是服务端而非客户端所以没有window对象。
看了下的源码里window是直接调用的,所以请求对window做一个判断处理,判断window对象是否存在。
Project running error reporting
你好,
我在手机上测试发现一个问题:第一次录音结束,播放录音; 销毁录音;
再次录音就不能播放了。
部署服务器后start()就直接异常了。8号之前是没有问题的但有第一次出现异常的时候是我在录屏的时候开启了你的录音然后服务器部署情况下就一直开始不了
非常感谢Issuse30的快速修复。
在手机端还发现暂停后不能恢复录音,桌面没有问题。也没有报错。
你好我们项目组在使用
recorder.start().catch(e => )的代码中,在浏览器拒绝音频录音时发现进不到catch函数中,所以请求能够在异常情况时能够在catch函数中调用以提示给用户
如题 用 Player.play(arraybuffer);总是报错,说不能解码
设置相同的采样率、通道、采样位数录制的音频文件大小与标准的音频计算方法计算的文件大小不一致
标准计算方法: 音频大小 = 采样率x声道数x采样位数字节数x时间
列:1600012*0.02(毫秒)=640
而插件得出的是2730
想问问怎么解决这个问题
提示 TypeError: this.onpauseplay is not a function 或 TypeError: this.onstopplay is not a function
求协助测试除pc端chrome以外的浏览器,例如:
pc端(或移动端) xx浏览器(xxx版本),运行成功。
或
pc端(或移动端) xx浏览器(xxx版本),运行失败,报错:......
safari 重复录音问题需要录音完销毁实例,然后重复录制的时候创建实例
但是销毁后播放、暂停、停止又无法使用
需要在销毁前录音blob存储起来,然后自己去创建audio
想用边录边获取数据,使用npm -i 下载的是最新的,怎么办
录音声音和播放声音音色不一样如何调整,demo可以原声播放,代码down下来后运行,播放音色略微厚重,这是什么问题呢
您的demo页面,无法立即使用,找不到代码。谢谢
暂停录音后,将数据深拷贝了,在拷贝的哪部分上播放后,原来的数据不能继续录音。为什么这种情况。
该如何在不下载文件的情况下,获取blob呢
我在一个vue页面 import Recorder from "js-audio-recorder";之后,没办法使用Player.play()。
使用 import Player from './player/player' 也是错误的。
我该如何做,才能正常使用这个函数?
可以解答一下吗,新手一个见谅
现在录音播放完成之后不能监听到该事件,不方便后续处理。
Error : 浏览器不支持 getUserMedia !
只有前端代码不用后端可以吗 后端我是用python的
android chrome浏览器是可以的。但是ios的貌似不行,是这样的吗?
@2fps 请问readme上提到的兼容性上是对ios和android同时测试的吗?
实时返回Byte类型的size。
可用于实现 达到设定的size大小,自动停止录制。 的功能。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.