Source
A Source represents audio you can play back. You can do interesting things with Sources, like set the volume, pitch, and its position relative to the listener. Please note that positional audio only works for mono (i.e. non-stereo) sources.
The Source controls (play/pause/etc) act according to the following state table.
Stopped | Playing | Paused | |
---|---|---|---|
play() | Play | No change | Play |
stop() | No change | Stop + Rewind | Stop + Rewind |
pause() | No change | Pause | No change |
resume() | No change | No change | Play |
rewind() | No change | Rewind + Play | Rewind + Pause |
And for fans of flowcharts (note: omitted calls have no effect, rewind does).
Constructors
love.audio.newSource | Creates a new Source from a file, SoundData, or Decoder. |
Functions
Object:type | Gets the type of the object as a string. | ||
Object:typeOf | Checks whether an object is of a certain type. | ||
Source:getAttenuationDistances | Gets the reference and maximum attenuation distances of the Source. |
![]() |
|
Source:getChannels | Gets the number of channels in the Source. |
![]() |
|
Source:getCone | Gets the Source's directional volume cones. |
![]() |
|
Source:getDirection | Gets the direction of the Source. |
![]() |
|
Source:getDistance | Returns the reference and maximum distance of the source. |
![]() |
![]() |
Source:getPosition | Gets the position of the Source. |
![]() |
|
Source:getVelocity | Gets the velocity of the Source. |
![]() |
|
Source:isPaused | Returns whether the Source is paused. | ||
Source:isPlaying | Returns whether the Source is playing. |
![]() |
|
Source:isRelative | Gets whether the Source's position and direction are relative to the listener. |
![]() |
|
Source:isStatic | Returns whether the Source is static. |
![]() |
|
Source:pause | Pauses a source. |
![]() |
|
Source:play | Plays a source. |
![]() |
|
Source:seek | Sets the currently playing position of the Source. |
![]() |
|
Source:setAttenuationDistances | Sets the reference and maximum attenuation distances of the Source. |
![]() |
|
Source:setCone | Sets the Source's directional volume cones. |
![]() |
|
Source:setDirection | Sets the direction of the Source. |
![]() |
|
Source:setDistance | Sets the reference and maximum distance of the source. |
![]() |
![]() |
Source:setPitch | Sets the pitch of the Source. | ||
Source:setPosition | Sets the position of the Source. |
![]() |
|
Source:setRelative | Sets whether the Source's position and direction are relative to the listener. |
![]() |
|
Source:setVelocity | Sets the velocity of the Source. |
![]() |
|
Source:tell | Gets the currently playing position of the Source. |
![]() |
Supertypes
See Also
Category: