class AudiosMgr {
	private static _instance: AudiosMgr;

	static get instance(): AudiosMgr {
		if (!this._instance) {
			this._instance = new AudiosMgr();
		}
		return this._instance;
	}
	private audiosRes = {};

	private constructor() {
	}

	/**获取sound资源 */
	private getAudioSource(soundName: string): egret.Sound {
		this.audiosRes[soundName] = this.audiosRes[soundName] || RES.getRes(soundName);

		return this.audiosRes[soundName];
	}

	private playSound(soundName: string, startTime: number = 0, loops: number = 1): egret.SoundChannel {
		return this.getAudioSource(soundName).play(startTime, loops);
	}

	public playButtonClick(): egret.SoundChannel {
		return this.playSound('button-click_mp3');
	}

	public playNewRound(): egret.SoundChannel {
		return this.playSound('xindeyilun_mp3');
	}

	public playWin(): egret.SoundChannel {
		return this.playSound('wintexiao_mp3');
	}
}