Comments (9)
自行检查音频内容是否是16位pcm,把base64保存起来,解码成二进制文件
拖进页面播放测试,8位 16位参数都试试
https://xiangyuecn.gitee.io/recorder/assets/工具-裸PCM转WAV播放测试.html
from recorder.
自行检查音频内容是否是16位pcm,把base64保存起来,解码成二进制文件
拖进页面播放测试,8位 16位参数都试试 https://xiangyuecn.gitee.io/recorder/assets/工具-裸PCM转WAV播放测试.html
感谢感谢,按照你说的解码成了二进制文件,拖进页面播放可以朗读出文字,之前是完全朗读不出来, 下面是我保存成文件测试的代码
function saveBase64AsFile(base64Str, fileName) {
const byteChars = atob(base64Str);
const byteNums = new Array(byteChars.length);
for (let i = 0; i < byteChars.length; i++) {
byteNums[i] = byteChars.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNums);
const file = new File([byteArray], fileName, { type: 'audio/octet-stream' });
// 保存文件
saveFile(file);
}
from recorder.
不支持双声道,简单点把 每4个字节 去掉后两个字节 转成单声道
from recorder.
不支持双声道,简单点把 每4个字节 去掉后两个字节 转成单声道
怎么转呀,这个是要算法同事转成单身道还是我们自己转,可以简单给下思路吗
from recorder.
1 1 2 2 1 1 2 2 1 1 2 2
每4个字节,只取前两个字节1 1,后两个字节2 2丢掉
from recorder.
1 1 2 2 1 1 2 2 1 1 2 2 每4个字节,只取前两个字节1 1,后两个字节2 2丢掉
方便提供下相关JS代码实现dem吗
from recorder.
https://xiangyuecn.gitee.io/recorder/assets/工具-裸PCM转WAV播放测试.html
这个页面源码里面有
from recorder.
我把采样率改成了44100 ,16bitRate单声道,没有杂音,但是语速特别块,比之前 16000, 16bitRate 双声道 清晰很多,且没有杂音, 不知道能不能调整朗读的语速
from recorder.
来反馈了,最后找到问题所在了, 算法同事给我返回的base64数据编码的pcm是浮点型的数据, 但是库中使用的是Int16Array操作的pcm,导致播放的音频有电流声, 不知道博主能不能考虑下支持浮点型。
from recorder.
Related Issues (20)
- 在chrome extension的content js环境中引入1.3.23120800版本的recorder-core不能正常工作,1.2.23070100可以正常工作。 HOT 2
- 如何获取到类似 const stream = await navigator.mediaDevices.getUserMedia({ audio: true });的媒体流 HOT 2
- 大佬请教一个问题 HOT 1
- 覆盖导入Recorder HOT 1
- 继续录音的时候onProces不会触发
- Failed to construct 'AudioContext'
- 调用Recorder.GetContext(true)得到的不是running状态的AudioContext, 而是suspended HOT 1
- Cannot read properties of undefined (reading 'i18n') HOT 2
- getUserMedia的audio值能设置成扬声器吗? HOT 3
- 默认播放一个背景音乐,当打开麦克风后背景音乐会转为听筒或者声音变得特别大在IOS中
- 请问每次录音第一次都不成功,第二次才成功录上怎么解决 HOT 2
- Open方法回调需要经过200ms多延时? HOT 3
- 发现同时多次调用open
- 如何自定义apiRequest HOT 1
- ios每次都要重新授权 有遇到吗 HOT 4
- Cannot read properties of undefined (reading 'input') HOT 1
- 录音失败:未加载audio/wav编码器 HOT 1
- 配置了type在停止录音时还是会报 -录音失败:未加载mp3编码器,请尝试到Recorder的src/engine内找到mp3的编码器并加载 HOT 3
- 在浙政厅里面用Recorder,显示 此浏览器不支持录音
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recorder.