Source

A Source is an object representing a single sound. Currently, only ogg sounds are supported. Sources can be in three different states:

Playing The source is currently playing. It can be stopped, paused, or rewound.
Paused The source is paused. It can be stopped, played/resumed, or rewound.
Stopped The source has been stopped. It can be played.

Constructor

lovr.audio.newSourceCreate a new Source.

Methods

Source:getFalloffGet the falloff parameters for the Source.
Source:setFalloffSet the falloff parameters for the Source.
Source:getSampleRateGet the sample rate of the Source.
Source:isPausedCheck if the Source is paused.
Source:isRelativeCheck if the Source is relative to the listener.
Source:setRelativeSet whether or not the Source is relative.
Source:getVelocityGet the velocity of the Source.
Source:setVelocitySet the velocity of the Source.
Source:getChannelCountGet the number of channels in the Source.
Source:getDirectionGet the direction vector of the Source.
Source:setDirectionSet the direction vector of the Source.
Source:getPitchGet the pitch of the Source.
Source:setPitchSet the pitch of the Source.
Source:getBitDepthGet the bit depth of the Source.
Source:isPlayingCheck if the Source is playing.
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.
Source:getConeGet the Source's volume cone.
Source:setConeSet the Source's volume cone.
Source:isLoopingCheck if the Source is looping.
Source:setLoopingSet whether or not the Source loops.
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:pausePause the Source.
Source:playPlay the Source.
Source:resumeResume the Source.
Source:rewindRewind the Source.
Source:getOrientationGet the orientation of the Source.
Source:setOrientationSet the orientation of the Source.
Source:seekSet the playback position of the Source.
Source:stopStop the Source.
Source:tellGet the playback position of the Source.
Source:isStoppedCheck if the Source is stopped.
Source:getDurationGet the duration of the Source.
Source:getTypeGet the SourceType of the Source.

See also