Browse Source

Fix AudioStream:append variants;

bjorn 5 years ago
parent
commit
7ac9295a2e
2 changed files with 31 additions and 10 deletions
  1. 28 4
      api/init.lua
  2. 3 6
      api/lovr/data/AudioStream/append.lua

+ 28 - 4
api/init.lua

@@ -3045,12 +3045,36 @@ return {
               },
               },
               variants = {
               variants = {
                 {
                 {
-                  arguments = {},
-                  returns = {}
+                  arguments = {
+                    {
+                      name = "blob",
+                      type = "Blob",
+                      description = "A Blob of sound bytes. Since it has no information about the format of the data, `append` blindly trusts that you give it valid data."
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "success",
+                      type = "boolean",
+                      description = "Whether this `append` did not exceed the queue limit, and data was thus appended to the queue."
+                    }
+                  }
                 },
                 },
                 {
                 {
-                  arguments = {},
-                  returns = {}
+                  arguments = {
+                    {
+                      name = "soundData",
+                      type = "SoundData",
+                      description = "A SoundData blob of sound bytes.  The format of the `SoundData` must match the format of the `AudioStream`."
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "success",
+                      type = "boolean",
+                      description = "Whether this `append` did not exceed the queue limit, and data was thus appended to the queue."
+                    }
+                  }
                 }
                 }
               }
               }
             },
             },

+ 3 - 6
api/lovr/data/AudioStream/append.lua

@@ -22,16 +22,14 @@ return {
     avoid stuttery playback. Having more than 0.2s audio queued at all times is a good guideline.
     avoid stuttery playback. Having more than 0.2s audio queued at all times is a good guideline.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'blob',
+    blob = {
       type = 'Blob',
       type = 'Blob',
       description = [[
       description = [[
         A Blob of sound bytes. Since it has no information about the format of the data,
         A Blob of sound bytes. Since it has no information about the format of the data,
         `append` blindly trusts that you give it valid data.
         `append` blindly trusts that you give it valid data.
       ]]
       ]]
     },
     },
-    {
-      name = 'soundData',
+    soundData = {
       type = 'SoundData',
       type = 'SoundData',
       description = [[
       description = [[
         A SoundData blob of sound bytes.  The format of the `SoundData` must match the format
         A SoundData blob of sound bytes.  The format of the `SoundData` must match the format
@@ -40,8 +38,7 @@ return {
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       type = 'boolean',
       description = [[
       description = [[
         Whether this `append` did not exceed the queue limit, and data was thus appended to the
         Whether this `append` did not exceed the queue limit, and data was thus appended to the