Source
A Source is an object representing a single sound. Currently, only ogg sounds are supported.
When a Source is playing, it will send audio to the speakers. Sources do not play automatically when they are created. Instead, the play
, pause
, and stop
functions can be used to control when they should play.
Source:seek
and Source:tell
can be used to control the playback position of the Source. A Source can be set to loop when it reaches the end using Source:setLooping
.
Constructor
lovr.audio.newSource | Create a new Source. |
Methods
Source:getBitDepth | Get the bit depth of the Source. |
Source:getChannelCount | Get the number of channels in the Source. |
Source:getCone | Get the Source's volume cone. |
Source:setCone | Set the Source's volume cone. |
Source:getDuration | Get the duration of the Source. |
Source:getFalloff | Get the falloff parameters for the Source. |
Source:setFalloff | Set the falloff parameters for the Source. |
Source:isLooping | Check if the Source is looping. |
Source:setLooping | Set whether or not the Source loops. |
Source:getOrientation | Get the orientation of the Source. |
Source:setOrientation | Set the orientation of the Source. |
Source:pause | Pause the Source. |
Source:getPitch | Get the pitch of the Source. |
Source:setPitch | Set the pitch of the Source. |
Source:play | Play the Source. |
Source:isPlaying | Check if the Source is playing. |
Source:getPose | Get the pose of the Source. |
Source:setPose | Set the pose of the Source. |
Source:getPosition | Get the position of the Source. |
Source:setPosition | Set the position of the Source. |
Source:isRelative | Check if the Source is relative to the listener. |
Source:setRelative | Set whether or not the Source is relative. |
Source:getSampleRate | Get the sample rate of the Source. |
Source:seek | Set the playback position of the Source. |
Source:stop | Stop the Source. |
Source:tell | Get the playback position of the Source. |
Source:getType | Get the SourceType of the Source. |
Source:getVelocity | Get the velocity of the Source. |
Source:setVelocity | Set the velocity of the Source. |
Source:getVolume | Get the volume of the Source. |
Source:setVolume | Set the volume of the Source. |
Source:getVolumeLimits | Get the volume limits of the Source. |
Source:setVolumeLimits | Set the volume limits of the Source. |
See also
lovr.audio