当前位置:网站首页>【oops-framework】音频管理
【oops-framework】音频管理
2022-07-21 05:16:00 【dgflash_game】
功能说明
OopsFramework-音频管理模块主要处理游戏背景音乐、游戏音效两大类功能。
演示程序
使用说明
播放背景音乐
oops.audio.playMusic("audios/nocturne");
注:调用此方法后,后台会异步下载音乐资源,完成后开始播放音乐
背景音乐播放完成回调设置
oops.audio.setMusicComplete(() => {
console.log("音乐播放完成");
});
获取或设置背景音乐音量
oops.audio.musicVolume = 0.5;
注:音量范围 (0 ~ 1)
背景音乐开关
oops.audio.switchMusic = false;
获取或设置音乐播放进度
oops.audio.progressMusic = 0.5;
注:音量进度 (0 ~ 1)
播放音效
oops.audio.playEffect("audios/Gravel");
注:调用此方法后,后台会异步下载音乐资源,完成后开始播放音乐
获取或设置音效音量
oops.audio.volumeEffect = 0.5;
注:音量范围 (0 ~ 1)
音效音乐开关
oops.audio.switchEffect = false;
恢复暂停的所有音乐播放
oops.audio.resumeAll();
暂停当前音乐与音效的播放
oops.audio.pauseAll();
停止当前音乐与音效的播放
oops.audio.stopAll();
停止当前音乐与音效的播放
oops.audio.stopAll();
保存音乐音效的音量、开关配置数据到本地
oops.audio.save();
本地加载音乐音效的音量、开关配置数据并设置到游戏中
oops.audio.load();
边栏推荐
猜你喜欢
Level 3 academic level test
In depth analysis of multiple knapsack problem (Part 2)
归并排序
328. Parity linked list
994. 腐烂的橘子
Let you know the current situation and future development trend of wireless charging technology
Combinatorial summary
数据库初学笔记
438. 找到字符串中所有字母异位词
Probability theory - law of large numbers and central limit theorem
随机推荐
力扣记录:单调栈——739 每日温度,496 下一个更大元素I,503 下一个更大元素II,42 接雨水,84 柱状图中最大的矩形
如何用数组模拟栈(超简易代码)
Explain the principle, classification and function of microphone array in detail
10th week ACM training report
ACM training report of the second week
What are the problems in the classification and future development of IOT devices?
230. The k-th smallest element in the binary search tree
994. 腐烂的橘子
14. Longest common prefix
Concurrency opening -- take you from 0 to 1 to build the cornerstone of concurrency knowledge system
543. Diameter of binary tree
110. Balanced binary tree
Built in WiFi and Bluetooth chip of Flathead brother xuantie
Merge sort
創意編程/小學組(4-6年級)-圖形化創意
226. 翻转二叉树
Redis主从复制的配置原理和过程
What opportunities and challenges does the development of instrument control panel face?
437. Path sum III
Which of these five special Bluetooth cores suits your application best