newSound.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. return {
  2. summary = 'Create a new Sound.',
  3. description = [[
  4. Creates a new Sound, which holds audio data. Audio can be stored as raw samples, compressed and
  5. decoded on the fly, or as a stream that can have audio written and read.
  6. ]],
  7. arguments = {
  8. samples = {
  9. type = 'number',
  10. description = 'The total number of samples for each channel.'
  11. },
  12. sampleRate = {
  13. type = 'number',
  14. default = '44100',
  15. description = 'The number of samples per second.'
  16. },
  17. bitDepth = {
  18. type = 'number',
  19. default = '16',
  20. description = 'The number of bits stored for each sample.'
  21. },
  22. channels = {
  23. type = 'number',
  24. default = '2',
  25. description = 'The number of channels in the sound (1 for mono, 2 for stereo).'
  26. },
  27. filename = {
  28. type = 'string',
  29. description = 'The filename of the sound to decode.'
  30. },
  31. blob = {
  32. type = 'string',
  33. description = 'The Blob containing compressed sound data to decode.'
  34. }
  35. },
  36. returns = {
  37. sound = {
  38. type = 'Sound',
  39. description = 'The new Sound.'
  40. }
  41. },
  42. variants = {
  43. {
  44. arguments = { 'filename' },
  45. returns = { 'sound' }
  46. },
  47. {
  48. arguments = { 'samples', 'sampleRate', 'bitDepth', 'channels' },
  49. returns = { 'sound' }
  50. },
  51. {
  52. arguments = { 'audioStream' },
  53. returns = { 'sound' }
  54. },
  55. {
  56. arguments = { 'blob' },
  57. returns = { 'sound' }
  58. }
  59. }
  60. }