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:getAbsorption | Get the absorption coefficients of the Source. |
| Source:getCone | Get the volume cone of the Source. |
| Source:getFalloff | Get the volume falloff of the Source. |
| Source:getOcclusion | Get the occlusion settings for 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:getReverb | Get the reverb settings for the Source. |
| Source:getSpatialization | Get the spatialization settings for the Source. |
| Source:isSpatial | Check if the Source is spatial. |
| Source:setAbsorption | Set the absorption coefficients of the Source. |
| Source:setCone | Set the volume cone of the Source. |
| Source:setFalloff | Set the volume falloff of the Source. |
| Source:setOcclusion | Set the occlusion settings for the Source. |
| 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. |
| Source:setReverb | Set the reverb settings for the Source. |
| Source:setSpatialization | Set the spatialization settings for the Source. |
Utility
| Source:clone | Create an identical copy of the Source. |
| Source:getSound | Get the Sound object backing the Source. |