import { AudioContextGroupManager } from "./audiocontext/AudioContextGroupManager" ; import { AudioType } from "./AudioType" ; import { HTMLAudioGroupManager } from "./html/HTMLAudioGroupManager" ; import { AudioGroupInterface } from "./interface/AudioGroupInterface" ; import { AudioGroupManagerInterface } from "./interface/AudioGroupManagerInterface" ; import { AudioInterface } from "./interface/AudioInterface" ; /**
 * 音频组的管理类
 */ export class AudioGroupManager { private static mAGM : AudioGroupManagerInterface ; /**
     * 要想使用声音，需要调用此函数初始化
     */ public static init ( useAudioType ) { this . mAGM = this . getAudioManager ( useAudioType ) ; } private static getAudioManager ( useAudioType ) { switch ( useAudioType ) { case AudioType . AUDIO_CONTEXT : return AudioContextGroupManager . getInstance ( ) ; case AudioType . HTML : return HTMLAudioGroupManager . getInstance ( ) ; } } param groupName public static getGroup ( groupName ) { return this . mAGM . getGroup ( groupName ) ; } param audio public static addAudio ( audio ) { this . mAGM . addAudio ( audio ) ; } param audio public static remove ( audio ) { this . mAGM . remove ( audio ) ; } param groupName public static getAudios ( groupName ? ) { return this . mAGM . getAudios ( groupName ) ; } param groupName public static getAlias ( groupName ? ) { return this . mAGM . getAlias ( groupName ) ; } param alias param groupName public static hasAlias ( alias , groupName ? ) { return this . mAGM . hasAlias ( alias , groupName ) ; } }