Browse Source

Update TimeUnit;

bjorn 4 years ago
parent
commit
3c78c0ac37
4 changed files with 12 additions and 9 deletions
  1. 5 4
      api/init.lua
  2. 1 1
      api/lovr/audio/Source/seek.lua
  3. 2 1
      api/lovr/audio/Source/tell.lua
  4. 4 3
      api/lovr/audio/TimeUnit.lua

+ 5 - 4
api/init.lua

@@ -891,7 +891,7 @@ return {
         {
           name = "TimeUnit",
           summary = "Time units for sound samples.",
-          description = "When figuring out how long a Source is or seeking to a specific position in the sound file, units can be expressed in terms of seconds or in terms of samples.",
+          description = "When figuring out how long a Source is or seeking to a specific position in the sound file, units can be expressed in terms of seconds or in terms of frames.  A frame is one set of samples for each channel (one sample for mono, two samples for stereo).",
           key = "TimeUnit",
           module = "lovr.audio",
           values = {
@@ -900,8 +900,8 @@ return {
               description = "Seconds."
             },
             {
-              name = "samples",
-              description = "Samples."
+              name = "frames",
+              description = "Frames."
             }
           }
         },
@@ -1989,7 +1989,7 @@ return {
               description = "Seeks the Source to the specified position.",
               key = "Source:seek",
               module = "lovr.audio",
-              notes = "This function can not be used on a Source backed by a raw `AudioStream`.",
+              notes = "Seeking a Source backed by a stream `Sound` has no meaningful effect.",
               variants = {
                 {
                   arguments = {
@@ -2245,6 +2245,7 @@ return {
               description = "Returns the current playback position of the Source.",
               key = "Source:tell",
               module = "lovr.audio",
+              notes = "The return value for Sources backed by a stream `Sound` has no meaning.",
               variants = {
                 {
                   arguments = {

+ 1 - 1
api/lovr/audio/Source/seek.lua

@@ -15,5 +15,5 @@ return {
     }
   },
   returns = {},
-  notes = 'This function can not be used on a Source backed by a raw `AudioStream`.'
+  notes = 'Seeking a Source backed by a stream `Sound` has no meaningful effect.'
 }

+ 2 - 1
api/lovr/audio/Source/tell.lua

@@ -15,5 +15,6 @@ return {
       type = 'number',
       description = 'The current playback position.'
     }
-  }
+  },
+  notes = 'The return value for Sources backed by a stream `Sound` has no meaning.'
 }

+ 4 - 3
api/lovr/audio/TimeUnit.lua

@@ -2,7 +2,8 @@ return {
   summary = 'Time units for sound samples.',
   description = [[
     When figuring out how long a Source is or seeking to a specific position in the sound file,
-    units can be expressed in terms of seconds or in terms of samples.
+    units can be expressed in terms of seconds or in terms of frames.  A frame is one set of samples
+    for each channel (one sample for mono, two samples for stereo).
   ]],
   values = {
     {
@@ -10,8 +11,8 @@ return {
       description = 'Seconds.'
     },
     {
-      name = 'samples',
-      description = 'Samples.'
+      name = 'frames',
+      description = 'Frames.'
     }
   }
 }