Merge pull request #599 from timothydillan/chore_timothy_dillan_fix_audio_decode_error

Fix: Compile error because of untyped spread argument in audioDecode utility function
This commit is contained in:
ShellTear
2024-01-22 02:32:33 +02:00
committed by GitHub

View File

@@ -209,7 +209,7 @@ export async function getAudioDuration(buffer: Buffer | string | Readable) {
*/
export async function getAudioWaveform(buffer: Buffer | string | Readable, logger?: Logger) {
try {
const audioDecode = (...args) => import('audio-decode').then(({ default: audioDecode }) => audioDecode(...args))
const audioDecode = (buffer: Buffer | ArrayBuffer | Uint8Array) => import('audio-decode').then(({ default: audioDecode }) => audioDecode(buffer))
let audioData: Buffer
if(Buffer.isBuffer(buffer)) {
audioData = buffer