如何保存媒体文件的 blob?
How to save the blob for media file?
我成功制作了波浪数据并得到类型和波浪,如下所示。
然后我使用 createObjectURL
它给了我 url http://localhost:3003/5025f231-f5d0-49f5-9851-600376de0065
但什么也没有。
如何制作真实文件??
感谢任何帮助...
console.log(type); //wave
console.log(data); //Blob {size: 6791616, type: "audio/wav"}
if (type == 'wav'){
//how can I save the .wav file from blob and give the parameter for user?
var dlUrl = URL.createObjectURL(data)
console.log(dlUrl); //it shows http://localhost:3003/5025f231-f5d0-49f5-9851-600376de0065, but there is no 5025f231-f5d0-49f5-9851-600376de0065 file.
}
我相信你必须在 url 前面添加一个 blob:
:
console.log(type); //wave
console.log(data); //Blob {size: 6791616, type: "audio/wav"}
if (type == 'wav'){
//how can I save the .wav file from blob and give the parameter for user?
var dlUrl = URL.createObjectURL(data)
console.log('blob:' + dlUrl); //it shows http://localhost:3003/5025f231-f5d0-49f5-9851-600376de0065 and there is 5025f231-f5d0-49f5-9851-600376de0065 file.
}
我成功制作了波浪数据并得到类型和波浪,如下所示。
然后我使用 createObjectURL
它给了我 url http://localhost:3003/5025f231-f5d0-49f5-9851-600376de0065
但什么也没有。
如何制作真实文件??
感谢任何帮助...
console.log(type); //wave
console.log(data); //Blob {size: 6791616, type: "audio/wav"}
if (type == 'wav'){
//how can I save the .wav file from blob and give the parameter for user?
var dlUrl = URL.createObjectURL(data)
console.log(dlUrl); //it shows http://localhost:3003/5025f231-f5d0-49f5-9851-600376de0065, but there is no 5025f231-f5d0-49f5-9851-600376de0065 file.
}
我相信你必须在 url 前面添加一个 blob:
:
console.log(type); //wave
console.log(data); //Blob {size: 6791616, type: "audio/wav"}
if (type == 'wav'){
//how can I save the .wav file from blob and give the parameter for user?
var dlUrl = URL.createObjectURL(data)
console.log('blob:' + dlUrl); //it shows http://localhost:3003/5025f231-f5d0-49f5-9851-600376de0065 and there is 5025f231-f5d0-49f5-9851-600376de0065 file.
}