MengYX
5 years ago
2 changed files with 19 additions and 2 deletions
@ -0,0 +1,14 @@ |
|||
const rawDecrypt = require("./raw"); |
|||
const util = require("./util"); |
|||
export {Decrypt} |
|||
const header = [0x00, 0x00, 0x00, 0x20, 0x66, 0x74, 0x79, 0x70]; |
|||
|
|||
async function Decrypt(file, raw_filename) { |
|||
const fileBuffer = await util.GetArrayBuffer(file); |
|||
const audioData = new Uint8Array(fileBuffer); |
|||
for (let cur = 0; cur < 8; ++cur) { |
|||
audioData[cur] = header[cur]; |
|||
} |
|||
const musicData = new Blob([audioData], {type: "audio/mp4"}); |
|||
return await rawDecrypt.Decrypt(musicData, raw_filename, "m4a") |
|||
} |
Loading…
Reference in new issue