fix:format file audio in audio detail download
This commit is contained in:
parent
0e166f6dd9
commit
34e8670983
|
|
@ -247,7 +247,17 @@ const DetailAudio = () => {
|
||||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||||
const contentType =
|
const contentType =
|
||||||
xhr.getResponseHeader("content-type") || "application/octet-stream";
|
xhr.getResponseHeader("content-type") || "application/octet-stream";
|
||||||
const extension = contentType.split("/")[1];
|
let extension = contentType.split("/")[1];
|
||||||
|
|
||||||
|
if (selectedSize === "MP3") {
|
||||||
|
extension = "mp3";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedSize === "WAV") {
|
||||||
|
extension = "wav";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const filename = `${name}.${extension}`;
|
const filename = `${name}.${extension}`;
|
||||||
|
|
||||||
const blob = new Blob([xhr.response], {
|
const blob = new Blob([xhr.response], {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue