From 52097b6ee7cc8f5a770eb851902560b5b8592218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 22 Feb 2021 21:05:36 +0800 Subject: add meta/3rd with acknowledgement --- meta/3rd/Cocos4.0/cc.AudioEngine.lua | 150 +++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 meta/3rd/Cocos4.0/cc.AudioEngine.lua (limited to 'meta/3rd/Cocos4.0/cc.AudioEngine.lua') diff --git a/meta/3rd/Cocos4.0/cc.AudioEngine.lua b/meta/3rd/Cocos4.0/cc.AudioEngine.lua new file mode 100644 index 00000000..d0db8ff4 --- /dev/null +++ b/meta/3rd/Cocos4.0/cc.AudioEngine.lua @@ -0,0 +1,150 @@ + +---@class cc.AudioEngine +local AudioEngine={ } +cc.AudioEngine=AudioEngine + + + + +---* +---@return boolean +function AudioEngine:lazyInit () end +---* Sets the current playback position of an audio instance.
+---* param audioID An audioID returned by the play2d function.
+---* param sec The offset in seconds from the start to seek to.
+---* return +---@param audioID int +---@param sec float +---@return boolean +function AudioEngine:setCurrentTime (audioID,sec) end +---* Gets the volume value of an audio instance.
+---* param audioID An audioID returned by the play2d function.
+---* 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.
+---* AudioEngine cache audio data on ios,mac, and win32 platform.
+---* warning This can lead to stop related audio first.
+---* 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.
+---* 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.
+---* param audioID An audioID returned by the play2d function.
+---* 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.
+---* 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.
+---* param audioID An audioID returned by the play2d function.
+---* 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.
+---* warning All audio will be stopped first. +---@return self +function AudioEngine:uncacheAll () end +---* Sets volume for an audio instance.
+---* param audioID An audioID returned by the play2d function.
+---* 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
+---* 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.
+---* param filePath The path of an audio file.
+---* param loop Whether audio instance loop or not.
+---* param volume Volume value (range from 0.0 to 1.0).
+---* param profile A profile for audio instance. When profile is not specified, default profile will be used.
+---* return An audio ID. It allows you to dynamically change the behavior of an audio instance on the fly.
+---* 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.
+---* param audioID An audioID returned by the play2d function.
+---* return The status of an audio instance. +---@param audioID int +---@return int +function AudioEngine:getState (audioID) end +---* Resume an audio instance.
+---* param audioID An audioID returned by the play2d function. +---@param audioID int +---@return self +function AudioEngine:resume (audioID) end +---* Stop an audio instance.
+---* param audioID An audioID returned by the play2d function. +---@param audioID int +---@return self +function AudioEngine:stop (audioID) end +---* Release objects relating to AudioEngine.
+---* warning It must be called before the application exit.
+---* lua endToLua +---@return self +function AudioEngine:endToLua () end +---* Gets the duration of an audio instance.
+---* param audioID An audioID returned by the play2d function.
+---* 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.
+---* param audioID An audioID returned by the play2d function.
+---* 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.
+---* 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 \ No newline at end of file -- cgit v1.2.3