summaryrefslogtreecommitdiff
path: root/meta/3rd/love2d/library/love.sound.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-20 16:40:27 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-20 16:40:27 +0800
commit4bad35e608179e74c9ce186fa2038573055e574b (patch)
treeb820b8f34ab9e8a92cb6093defaab7f65ee13cbd /meta/3rd/love2d/library/love.sound.lua
parentee83c8939fdb9547bba993132e71a0638949abe9 (diff)
downloadlua-language-server-4bad35e608179e74c9ce186fa2038573055e574b.zip
first step of love2d-api
Diffstat (limited to 'meta/3rd/love2d/library/love.sound.lua')
-rw-r--r--meta/3rd/love2d/library/love.sound.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/meta/3rd/love2d/library/love.sound.lua b/meta/3rd/love2d/library/love.sound.lua
new file mode 100644
index 00000000..e44eabfa
--- /dev/null
+++ b/meta/3rd/love2d/library/love.sound.lua
@@ -0,0 +1,19 @@
+---@class love.sound
+love.sound = {}
+
+---
+---Attempts to find a decoder for the encoded sound data in the specified file.
+---
+---@param file File # The file with encoded sound data.
+---@param buffer number # The size of each decoded chunk, in bytes.
+---@return Decoder decoder # A new Decoder object.
+function love.sound.newDecoder(file, buffer) end
+
+---
+---Creates new SoundData from a filepath, File, or Decoder. It's also possible to create SoundData with a custom sample rate, channel and bit depth.
+---
+---The sound data will be decoded to the memory in a raw format. It is recommended to create only short sounds like effects, as a 3 minute song uses 30 MB of memory this way.
+---
+---@param filename string # The file name of the file to load.
+---@return SoundData soundData # A new SoundData object.
+function love.sound.newSoundData(filename) end