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[]][] = [ const fileSignatures: [AudioType, number[]][] = [
[AudioType.Mp3, [0x49, 0x44, 0x33]], [AudioType.Mp3, [0x49, 0x44, 0x33]],
[AudioType.Ogg, [0x4f, 0x67, 0x67, 0x53]], [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.Flac, [0x66, 0x4c, 0x61, 0x43]],
[AudioType.Aac, [0xff, 0xf1]], [AudioType.Aac, [0xff, 0xf1]],
[AudioType.Aac, [0xff, 0xf9]] [AudioType.Aac, [0xff, 0xf9]]
@ -87,7 +87,7 @@ export abstract class AudioDecoder {
logger.error( logger.error(
25, 25,
[...toCheck] [...toCheck]
.map(v => v.toString().padStart(2, '0')) .map(v => v.toString(16).padStart(2, '0'))
.join(' ') .join(' ')
.toUpperCase() .toUpperCase()
); );

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

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