Source
EditA Source is an object representing a single sound. Currently ogg, wav, and mp3 formats 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
.
Constructors
lovr.audio.newSource | Create a new Source. |
Source:clone | Create an identical copy of the Source. |
Playback
Source:getDuration | Get the duration of the Source. |
Source:getPitch | Get the pitch of the Source. |
Source:getVolume | Get the volume of the Source. |
Source:isLooping | Check if the Source is looping. |
Source:isPlaying | Check if the Source is playing. |
Source:pause | Pause the Source. |
Source:play | Play the Source. |
Source:seek | Set the playback position of the Source. |
Source:setLooping | Set whether or not the Source loops. |
Source:setPitch | Set the pitch of the Source. |
Source:setVolume | Set the volume of the Source. |
Source:stop | Stop the Source. |
Source:tell | Get the playback position of the Source. |
Effects
Source:getDirectivity | Get the directivity of the Source. |
Source:getOrientation | Get the orientation of the Source. |
Source:getPose | Get the pose of the Source. |
Source:getPosition | Get the position of the Source. |
Source:getRadius | Get the radius of the Source. |
Source:isEffectEnabled | Check if an effect is enabled. |
Source:isSpatial | Check if the Source is spatial. |
Source:setDirectivity | Set the directivity of the Source. |
Source:setEffectEnabled | Enable or disable an effect. |
Source:setOrientation | Set the orientation of the Source. |
Source:setPose | Set the pose of the Source. |
Source:setPosition | Set the position of the Source. |
Source:setRadius | Set the radius of the Source. |
Utility
Source:clone | Create an identical copy of the Source. |
Source:getSound | Get the Sound object backing the Source. |