summaryrefslogtreecommitdiff
path: root/meta/3rd/Cocos4.0/cc.AudioEngine.lua
blob: a43c9e2b1d816f810ef47ce9ce47d04b305851a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---@meta

---@class cc.AudioEngine 
local AudioEngine={ }
cc.AudioEngine=AudioEngine




---* 
---@return boolean
function AudioEngine:lazyInit () end
---* Sets the current playback position of an audio instance.<br>
---* param audioID   An audioID returned by the play2d function.<br>
---* param sec       The offset in seconds from the start to seek to.<br>
---* return 
---@param audioID int
---@param sec float
---@return boolean
function AudioEngine:setCurrentTime (audioID,sec) end
---* Gets the volume value of an audio instance.<br>
---* param audioID An audioID returned by the play2d function.<br>
---* return Volume value (range from 0.0 to 1.0).
---@param audioID int
---@return float
function AudioEngine:getVolume (audioID) end
---* Uncache the audio data from internal buffer.<br>
---* AudioEngine cache audio data on ios,mac, and win32 platform.<br>
---* warning This can lead to stop related audio first.<br>
---* param filePath Audio file path.
---@param filePath string
---@return self
function AudioEngine:uncache (filePath) end
---*  Resume all suspended audio instances. 
---@return self
function AudioEngine:resumeAll () end
---*  Stop all audio instances. 
---@return self
function AudioEngine:stopAll () end
---* Pause an audio instance.<br>
---* param audioID An audioID returned by the play2d function.
---@param audioID int
---@return self
function AudioEngine:pause (audioID) end
---* Gets the maximum number of simultaneous audio instance of AudioEngine.
---@return int
function AudioEngine:getMaxAudioInstance () end
---* Check whether AudioEngine is enabled.
---@return boolean
function AudioEngine:isEnabled () end
---* Gets the current playback position of an audio instance.<br>
---* param audioID An audioID returned by the play2d function.<br>
---* return The current playback position of an audio instance.
---@param audioID int
---@return float
function AudioEngine:getCurrentTime (audioID) end
---* Sets the maximum number of simultaneous audio instance for AudioEngine.<br>
---* param maxInstances The maximum number of simultaneous audio instance.
---@param maxInstances int
---@return boolean
function AudioEngine:setMaxAudioInstance (maxInstances) end
---* Checks whether an audio instance is loop.<br>
---* param audioID An audioID returned by the play2d function.<br>
---* return Whether or not an audio instance is loop.
---@param audioID int
---@return boolean
function AudioEngine:isLoop (audioID) end
---*  Pause all playing audio instances. 
---@return self
function AudioEngine:pauseAll () end
---* Uncache all audio data from internal buffer.<br>
---* warning All audio will be stopped first.
---@return self
function AudioEngine:uncacheAll () end
---* Sets volume for an audio instance.<br>
---* param audioID An audioID returned by the play2d function.<br>
---* param volume Volume value (range from 0.0 to 1.0).
---@param audioID int
---@param volume float
---@return self
function AudioEngine:setVolume (audioID,volume) end
---@overload fun(string:string,function:function):self
---@overload fun(string:string):self
---@param filePath string
---@param callback function
---@return self
function AudioEngine:preload (filePath,callback) end
---* Whether to enable playing audios<br>
---* note If it's disabled, current playing audios will be stopped and the later 'preload', 'play2d' methods will take no effects.
---@param isEnabled boolean
---@return self
function AudioEngine:setEnabled (isEnabled) end
---* Play 2d sound.<br>
---* param filePath The path of an audio file.<br>
---* param loop Whether audio instance loop or not.<br>
---* param volume Volume value (range from 0.0 to 1.0).<br>
---* param profile A profile for audio instance. When profile is not specified, default profile will be used.<br>
---* return An audio ID. It allows you to dynamically change the behavior of an audio instance on the fly.<br>
---* see `AudioProfile`
---@param filePath string
---@param loop boolean
---@param volume float
---@param profile cc.AudioProfile
---@return int
function AudioEngine:play2d (filePath,loop,volume,profile) end
---* Returns the state of an audio instance.<br>
---* param audioID An audioID returned by the play2d function.<br>
---* return The status of an audio instance.
---@param audioID int
---@return int
function AudioEngine:getState (audioID) end
---* Resume an audio instance.<br>
---* param audioID An audioID returned by the play2d function.
---@param audioID int
---@return self
function AudioEngine:resume (audioID) end
---* Stop an audio instance.<br>
---* param audioID An audioID returned by the play2d function.
---@param audioID int
---@return self
function AudioEngine:stop (audioID) end
---* Release objects relating to AudioEngine.<br>
---* warning It must be called before the application exit.<br>
---* lua endToLua
---@return self
function AudioEngine:endToLua () end
---* Gets the duration of an audio instance.<br>
---* param audioID An audioID returned by the play2d function.<br>
---* return The duration of an audio instance.
---@param audioID int
---@return float
function AudioEngine:getDuration (audioID) end
---* Sets whether an audio instance loop or not.<br>
---* param audioID An audioID returned by the play2d function.<br>
---* param loop Whether audio instance loop or not.
---@param audioID int
---@param loop boolean
---@return self
function AudioEngine:setLoop (audioID,loop) end
---* Gets the default profile of audio instances.<br>
---* return The default profile of audio instances.
---@return cc.AudioProfile
function AudioEngine:getDefaultProfile () end
---@overload fun(int0:string):self
---@overload fun(int:int):self
---@param audioID int
---@return cc.AudioProfile
function AudioEngine:getProfile (audioID) end
---* Gets playing audio count.
---@return int
function AudioEngine:getPlayingAudioCount () end