AudioSource
clay.audio.AudioSource (Class)
Instance Members
app: clay.Claydata: AudioDatastreamBufferLength: IntStreams only: The size in bytes of a single stream buffer. This is ~1 sec in 16 bit mono. default:176400 for most cases this can be left alone.
streamBufferCount: IntStreams only: The number of buffers to queue up. default:2 For most cases this can be left alone.
destroyed: BoolWhether this source has been destroyed
sourceId: StringA unique key for this source
instance(handle: AudioHandle): AudioInstanceCalled by the audio system to obtain a new instance of this source.
| Name | Type |
|---|---|
handle |
AudioHandle |
| Returns |
|---|
| AudioInstance |
A helper for converting bytes to seconds for a sound source
| Name | Type |
|---|---|
bytes |
Int |
| Returns |
|---|
| Float |
A helper for converting seconds to bytes for this audio source
| Name | Type |
|---|---|
seconds |
Float |
| Returns |
|---|
| Int |
getDuration(): Float| Returns |
|---|
| Float |
destroy(): Void| Name | Type |
|---|---|
app |
clay.Clay |
data |
AudioData |
Private Members
instances: Array<AudioInstance>Local list of instances spawned from this source. used when destroying the source, to take instances with it.
instanceKilled(instance: AudioInstance): Void| Name | Type |
|---|---|
instance |
AudioInstance |