|
@@ -1,7 +1,10 @@
|
|
return {
|
|
return {
|
|
summary = 'Create a new AudioStream.',
|
|
summary = 'Create a new AudioStream.',
|
|
description = [[
|
|
description = [[
|
|
- Creates a new AudioStream. Right now, the only supported audio format is Ogg Vorbis (.ogg).
|
|
|
|
|
|
+ Creates a new AudioStream. AudioStream has two modes:
|
|
|
|
+
|
|
|
|
+ 1. Constructed with a filename or blob, AudioStream will decode the given file on demand. Right now, the only supported audio format is Ogg Vorbis (.ogg).
|
|
|
|
+ 2. Constructed without, it's a "raw" audiostream that you append data to in real-time. See `AudioStream:append` for usage.
|
|
]],
|
|
]],
|
|
arguments = {
|
|
arguments = {
|
|
filename = {
|
|
filename = {
|
|
@@ -16,6 +19,15 @@ return {
|
|
type = 'number',
|
|
type = 'number',
|
|
default = '4096',
|
|
default = '4096',
|
|
description = 'The size of the stream\'s audio buffer, in samples.'
|
|
description = 'The size of the stream\'s audio buffer, in samples.'
|
|
|
|
+ },
|
|
|
|
+ queueLimit = {
|
|
|
|
+ type = 'number',
|
|
|
|
+ default = 'sampleRate*0.5',
|
|
|
|
+ description = 'The maximum number of audio samples that this AudioStream will queue. The default is half a second worth of data. Set to 0 for no limit (but be careful not to use too much RAM).'
|
|
|
|
+ },
|
|
|
|
+ channelCount = {
|
|
|
|
+ type = 'number',
|
|
|
|
+ description = 'Number of audio channels (1 for mono or 2 for stereo)'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
returns = {
|
|
returns = {
|
|
@@ -26,12 +38,19 @@ return {
|
|
},
|
|
},
|
|
variants = {
|
|
variants = {
|
|
{
|
|
{
|
|
|
|
+ description = 'Create an `AudioStream` decoding ogg audio from the file at `filename`',
|
|
arguments = { 'filename', 'bufferSize' },
|
|
arguments = { 'filename', 'bufferSize' },
|
|
returns = { 'audioStream' }
|
|
returns = { 'audioStream' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
|
|
+ description = 'Create an `AudioStream` decoding ogg audio from the given blob.',
|
|
arguments = { 'blob', 'bufferSize' },
|
|
arguments = { 'blob', 'bufferSize' },
|
|
returns = { 'audioStream' }
|
|
returns = { 'audioStream' }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ description = 'Create a raw `AudioStream`. You must call `append` to give it audio to stream later.',
|
|
|
|
+ arguments = { 'channelCount', 'sampleRate', 'bufferSize', 'queueLimit'},
|
|
|
|
+ returns = { 'audioStream' }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|