gpt4 book ai didi

android - react-native-audio-toolkit录制错误

转载 作者:行者123 更新时间:2023-12-03 01:39:42 25 4
gpt4 key购买 nike

您好,当我用react-native-audio-toolkit录制时,以下输出是垃圾,应该是wav或mp3。我究竟做错了什么?

  let rec = new Recorder('adrec.mp3', {bitrate: 128000, channels: 2, sampleRate: 44100}).prepare((err, fsPath) => {
if (err) {
console.log('error at as23424')
console.log(err)
} else {
filePathRec = fsPath
}
})

rec.record()

// Stop recording after approximately 3 seconds
setTimeout(() => {
rec.stop((err) => {
// NOTE: In a real situation, handle possible errors here
if (err) {

} else {

RNFS.readFile(filePathRec, 'base64').then((content) => {

输出:
AAAAGGZ0eXAzZ3A0AAAAAGlzb20zZ3A0AAAVCG1kYXQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAEAAAAMdXJsIAAAAAEAAACxc3RibAAAAEVzdHNkAAAAAAAAAAEAAAA1c2FtcgAAAAAAAAABAAAAAAAAAAAAAQAQAAAAAB9AAAAAAAARZGFtciAgIAAAg/8AAQAAACBzdHRzAAAAAAAAAAIAAAABAAAAoAAAAKcAAACgAAAAFHN0c3oAAAAAAAAAIAAAAKgAAAAcc3RzYwAAAAAAAAABAAAAAQAAAKgAAAABAAAAFHN0Y28AAAAAAAAAAQAAACA=

如您所见,很多A

最佳答案

输出是音频文件的base64编码版本。如果要出于测试目的对其进行解码,请在e处输入。 G。 this website

它将您的base64字符串解码为3秒钟的 3gp音频文件。据我所知,没有声音(这就是为什么A这么多的原因),但是基本上创建了一个有效的音频文件。

要使用另一种音频格式,请查看文档(Recorder methods),并在Recorder构造函数中指定一个:

new Recorder('adrec.mp3', {bitrate: 128000, channels: 2, sampleRate: 44100, format: 'aac'})

关于android - react-native-audio-toolkit录制错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48417167/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com