lovr.audio.newSource

Creates a new Source from an ogg file.

source = lovr.audio.newSource(filename, type)

Arguments

NameTypeDescription
filenamestringThe filename of the sound to load.
typeSourceTypeHow to stream in audio data.

Returns

NameTypeDescription
sourceSourceThe new Source.

source = lovr.audio.newSource(blob, type)

Arguments

NameTypeDescription
blobBlobThe Blob containing the Source data.
typeSourceTypeHow to stream in audio data.

Returns

NameTypeDescription
sourceSourceThe new Source.

source = lovr.audio.newSource(stream, type)

Arguments

NameTypeDescription
streamAudioStreamThe AudioStream used to stream audio data to the Source.
typeSourceTypeHow to stream in audio data.

Returns

NameTypeDescription
sourceSourceThe new Source.

source = lovr.audio.newSource(soundData)

Arguments

NameTypeDescription
soundDataSoundDataThe SoundData containing raw audio samples to play.

Returns

NameTypeDescription
sourceSourceThe new Source.

See also