Black Trigram (흑괘) - Korean Martial Arts Combat Simulator API - v0.7.55
    Preparing search index...

    Class AudioManager

    Manages audio playback for the Black Trigram combat game.

    Handles music tracks, sound effects, and Korean martial arts audio including technique sounds, trigram stance audio, and vital point hit feedback. Uses an LRU asset cache, pooled HTMLAudioElement instances, and an AudioMonitor for performance tracking.

    const audio = new AudioManager({ masterVolume: 0.8 });
    await audio.initialize();
    await audio.playMusic("dojang_theme");
    await audio.playSFX("hit_medium");

    오디오관리자

    Implements

    Index

    Accessors

    Constructors

    Methods

    • Batch load multiple assets with progress tracking

      Parameters

      • assets: readonly AudioAsset[]

        Array of audio assets to load

      • Optionaloptions: LoadOptions

        Optional load configuration (timeout, retries, etc.)

      • OptionalonProgress: (loaded: number, total: number) => void

        Optional callback for progress updates with loaded and total counts

      Returns Promise<void>

      Promise that resolves when all assets are processed

    • Parameters

      • fromTrackId: string
      • toTrackId: string
      • duration: number = 1000

      Returns Promise<void>

    • Estimate audio asset size in bytes 바이트 단위의 오디오 자산 크기 추정

      Parameters

      Returns number

      Estimated size in bytes

    • Get cache statistics including LRU cache metrics LRU 캐시 메트릭을 포함한 캐시 통계 가져오기

      Returns {
          lruCache: {
              assetCount: number;
              criticalCount: number;
              evictionCount: number;
              hitCount: number;
              hitRate: number;
              missCount: number;
              totalSize: number;
              utilizationPercent: number;
          };
          poolStats: Map<string, PoolStatistics>;
          soundCache: number;
      }

      Cache statistics

    • Get FPS impact analysis showing baseline vs current FPS and detected drops

      Returns AudioFPSImpact

      FPS impact analysis object

    • Returns ReadonlyMap<string, HTMLAudioElement>

      A snapshot of all currently loaded sound elements

    • Get loader statistics including cached assets and loading state

      Returns { cached: number; loading: number; totalAttempts: number }

      Loader statistics object

    • Get memory statistics including total loaded MB, asset count, and warnings

      Returns AudioMemoryStats

      Memory statistics object

    • Get all memory warnings

      Returns readonly MemoryWarning[]

      Array of memory warnings

    • Get comprehensive monitoring report including memory, performance, FPS, and warnings

      Returns {
          fps: AudioFPSImpact;
          memory: AudioMemoryStats;
          performance: AudioPerformanceStats;
          warnings: readonly MemoryWarning[];
      }

      Comprehensive monitoring report object

    • Get performance statistics including load times and playback latency

      Returns AudioPerformanceStats

      Performance statistics object

    • Get pool statistics for a specific asset or all pools

      Parameters

      • OptionalassetId: string

        Optional asset ID to get specific pool stats

      Returns PoolStatistics | Map<string, PoolStatistics> | undefined

      Pool statistics for the specified asset or all pools

    • Alias for playSoundEffect — preferred for explicit volume control.

      Parameters

      • id: string

        Sound effect identifier

      • Optionalvolume: number

        Override volume (defaults to sfxVolume × masterVolume)

      Returns Promise<void>

    • Helper method to release pooled audio back to the pool after playback

      Parameters

      • id: string

        Asset ID

      • audio: HTMLAudioElement

        Audio element to release

      Returns void

    • Unload an asset to free memory

      Parameters

      • assetId: string

        ID of the asset to unload

      Returns boolean

      true if asset was unloaded, false if asset was not found

    • Update FPS measurement for monitoring

      Parameters

      • fps: number

        Current frames per second measurement

      Returns void

    • Wait for a music asset to finish loading 음악 자산 로드가 완료될 때까지 대기

      Parameters

      • id: string

        Music track ID

      • maxWaitMs: number = 5000

        Maximum time to wait in milliseconds

      Returns Promise<void>

    Properties

    _currentMusicTrack: string | null = null
    _fallbackMode: boolean = false
    _isInitialized: boolean = false
    _masterVolume: number = 1.0
    _musicVolume: number = 0.7
    _muted: boolean = false
    _sfxVolume: number = 0.8
    assetLoader: AudioAssetLoader
    audioCache: AudioCache
    audioPool: AudioElementPool
    currentMusic: HTMLAudioElement | null = null
    frequentSounds: Set<string> = ...
    loadingMusic: Set<string> = ...

    Music assets currently being loaded — prevents race conditions on concurrent playMusic calls

    monitor: AudioMonitor
    soundCache: Map<string, HTMLAudioElement> = ...