Skip to content

Commit d15e123

Browse files
author
Florian Treml
committed
Handling MP3 files
1 parent 13c0ed6 commit d15e123

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

frontend/src/convert/convert.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const _isMP3 = (buf) => {
2222
buf[1] === 68 &&
2323
buf[2] === 51) || (
2424
buf[0] === 255 &&
25-
(buf[1] === 251 || buf[1] === 250)
25+
(buf[1] === 251 || buf[1] === 250 || buf[1] === 243 || buf[1] === 242)
2626
)
2727
}
2828

@@ -53,6 +53,14 @@ const runconvert = async (cmdLine, outputName, { inputBuffer, start, end }) => {
5353
throw new Error('identification of input file type failed')
5454
}
5555
}
56+
if (inputtype) {
57+
try {
58+
fs.renameSync(input, `${input}.${inputtype}`)
59+
input = `${input}.${inputtype}`
60+
} catch (err) {
61+
debug(`renaming of input file ${input} with extension ${inputtype} failed: ${err.message}`)
62+
}
63+
}
5664
if (!outputName) {
5765
outputName = `output.${inputtype}`
5866
}

0 commit comments

Comments
 (0)