fix: wav 文件头

This commit is contained in:
unanmed 2025-01-19 16:29:31 +08:00
parent 4d0331d5e8
commit a3ad9815aa
2 changed files with 35 additions and 32 deletions

View File

@ -7,7 +7,7 @@ import type { AudioPlayer } from './player';
const fileSignatures: [AudioType, number[]][] = [
[AudioType.Mp3, [0x49, 0x44, 0x33]],
[AudioType.Ogg, [0x4f, 0x67, 0x67, 0x53]],
[AudioType.Wav, [52, 0x49, 0x46, 0x46]],
[AudioType.Wav, [0x52, 0x49, 0x46, 0x46]],
[AudioType.Flac, [0x66, 0x4c, 0x61, 0x43]],
[AudioType.Aac, [0xff, 0xf1]],
[AudioType.Aac, [0xff, 0xf9]]
@ -87,7 +87,7 @@ export abstract class AudioDecoder {
logger.error(
25,
[...toCheck]
.map(v => v.toString().padStart(2, '0'))
.map(v => v.toString(16).padStart(2, '0'))
.join(' ')
.toUpperCase()
);

63
src/source/data.d.ts vendored
View File

@ -1,3 +1,4 @@
type FloorIds =
| 'empty'
| 'MT0'
@ -105,7 +106,7 @@ type FloorIds =
| 'MT94'
| 'MT95'
| 'MT96'
| 'MT97';
| 'MT97'
type ImageIds =
| 'IQ.png'
@ -139,7 +140,7 @@ type ImageIds =
| 'tower7.webp'
| 'winskin.png'
| 'winskin2.png'
| 'winskin3.png';
| 'winskin3.png'
type AnimationIds =
| 'amazed'
@ -163,7 +164,7 @@ type AnimationIds =
| 'sweat'
| 'sweat2'
| 'sword'
| 'zone';
| 'zone'
type SoundIds =
| '008-System08.opus'
@ -205,7 +206,7 @@ type SoundIds =
| 'shop.opus'
| 'thunder.opus'
| 'tree.opus'
| 'zone.opus';
| 'zone.opus'
type BgmIds =
| 'beforeBoss.opus'
@ -228,33 +229,35 @@ type BgmIds =
| 'towerBoss2.opus'
| 'towerBoss3.opus'
| 'winter.opus'
| 'winterTown.opus';
| 'winterTown.opus'
type FontIds = 'normal' | 'FiraCode';
type FontIds =
| 'normal'
| 'FiraCode'
interface NameMap {
: 'confirm.opus';
: 'cancel.opus';
: 'error.opus';
: 'cursor.opus';
: 'open_ui.opus';
: 'load.opus';
: 'save.opus';
: 'item.opus';
: 'recovery.opus';
: 'bomb.opus';
: 'centerFly.opus';
: 'door.opus';
: 'floor.opus';
: 'jump.opus';
: 'pickaxe.opus';
: 'icePickaxe.opus';
: 'gem.opus';
: 'zone.opus';
穿: 'equip.opus';
: 'bgm.opus';
: 'attack.opus';
: 'bg.jpg';
: 'shop.opus';
: 'zone';
'确定': 'confirm.opus';
'取消': 'cancel.opus';
'操作失败': 'error.opus';
'光标移动': 'cursor.opus';
'打开界面': 'open_ui.opus';
'读档': 'load.opus';
'存档': 'save.opus';
'获得道具': 'item.opus';
'回血': 'recovery.opus';
'炸弹': 'bomb.opus';
'飞行器': 'centerFly.opus';
'开关门': 'door.opus';
'上下楼': 'floor.opus';
'跳跃': 'jump.opus';
'破墙镐': 'pickaxe.opus';
'破冰镐': 'icePickaxe.opus';
'宝石': 'gem.opus';
'阻激夹域': 'zone.opus';
'穿脱装备': 'equip.opus';
'背景音乐': 'bgm.opus';
'攻击': 'attack.opus';
'背景图': 'bg.jpg';
'商店': 'shop.opus';
'领域': 'zone';
}