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.newSourceCreate a new Source.

Methods

Source:getBitDepthGet the bit depth of the Source.
Source:getChannelCountGet the number of channels in the Source.
Source:getConeGet the Source's volume cone.
Source:setConeSet the Source's volume cone.
Source:getDurationGet the duration of the Source.
Source:getFalloffGet the falloff parameters for the Source.
Source:setFalloffSet the falloff parameters for the Source.
Source:isLoopingCheck if the Source is looping.
Source:setLoopingSet whether or not the Source loops.
Source:getOrientationGet the orientation of the Source.
Source:setOrientationSet the orientation of the Source.
Source:pausePause the Source.
Source:getPitchGet the pitch of the Source.
Source:setPitchSet the pitch of the Source.
Source:playPlay the Source.
Source:isPlayingCheck if the Source is playing.
Source:getPoseGet the pose of the Source.
Source:setPoseSet the pose of the Source.
Source:getPositionGet the position of the Source.
Source:setPositionSet the position of the Source.
Source:isRelativeCheck if the Source is relative to the listener.
Source:setRelativeSet whether or not the Source is relative.
Source:getSampleRateGet the sample rate of the Source.
Source:seekSet the playback position of the Source.
Source:stopStop the Source.
Source:tellGet the playback position of the Source.
Source:getTypeGet the SourceType of the Source.
Source:getVelocityGet the velocity of the Source.
Source:setVelocitySet the velocity of the Source.
Source:getVolumeGet the volume of the Source.
Source:setVolumeSet the volume of the Source.
Source:getVolumeLimitsGet the volume limits of the Source.
Source:setVolumeLimitsSet the volume limits of the Source.

See also