deploying mp2 player

This commit is contained in:
minjaesong
2023-01-15 16:42:09 +09:00
parent 6cb45f6d50
commit af03ab23aa
8 changed files with 226 additions and 969 deletions

View File

@@ -127,7 +127,9 @@ function printPlayBar(startOffset) {
con.mvaddch(cy, 16 + Math.round(paintWidth * (currently / total)), 0xDB)
}
}
let errorlevel = 0
// read chunks loop
try {
while (!stopPlay && seqread.getReadCount() < FILE_SIZE - 8) {
let chunkName = seqread.readFourCC()
let chunkSize = seqread.readInt()
@@ -267,7 +269,15 @@ while (!stopPlay && seqread.getReadCount() < FILE_SIZE - 8) {
printdbg(`remainingBytes2 = ${remainingBytes}`)
sys.spin()
}
}
catch (e) {
printerrln(e)
errorlevel = 1
}
finally {
//audio.stop(0)
if (readPtr !== undefined) sys.free(readPtr)
if (decodePtr !== undefined) sys.free(decodePtr)
}
//audio.stop(0)
if (readPtr !== undefined) sys.free(readPtr)
if (decodePtr !== undefined) sys.free(decodePtr)
return errorlevel