Difference between revisions of "love.audiodisconnected"

(Created page with "{{newin|12.0|120|type=callback}} Called when the active audio device is disconnected (e.g. physically unplugging headphones). All audio are stopped '''and''' loses their...")
 
m
 
Line 7: Line 7:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
reconnect = love.audiodisconnected( sources )
+
reconnected = love.audiodisconnected( sources )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
 
{{param|table|sources|List of [[Source|sources]] that was playing.}}
 
{{param|table|sources|List of [[Source|sources]] that was playing.}}
 
=== Returns ===
 
=== Returns ===
{{param|boolean|reconnect|Should LÖVE try re-connect to default device?}}
+
{{param|boolean|reconnected|Is audio re-connection attempt has been done?}}
  
 
== Notes ==
 
== Notes ==
If [[love.audio.setPlaybackDevice]] is called inside the callback, false must be returned to prevent LOVE from re-connecting the device twice.
+
If [[love.audio.setPlaybackDevice]] is called inside the callback, <code>true</code> must be returned to prevent LÖVE from re-connecting the audio device again.
  
 
== See Also ==
 
== See Also ==

Latest revision as of 08:46, 13 October 2022

Available since LÖVE 12.0
This callback is not supported in earlier versions.

Called when the active audio device is disconnected (e.g. physically unplugging headphones).

All audio are stopped and loses their playback position when this callback is called.

Function

Synopsis

reconnected = love.audiodisconnected( sources )

Arguments

table sources
List of sources that was playing.

Returns

boolean reconnected
Is audio re-connection attempt has been done?

Notes

If love.audio.setPlaybackDevice is called inside the callback, true must be returned to prevent LÖVE from re-connecting the audio device again.

See Also


Other Languages