stop.lua 774 B

1234567891011121314151617181920212223242526272829303132
  1. return {
  2. tag = 'devices',
  3. summary = 'Stop an audio device.',
  4. description = [[
  5. Stops the active playback or capture device. This may fail if:
  6. - The device is not started
  7. - No device was initialized with `lovr.audio.setDevice`
  8. ]],
  9. arguments = {
  10. {
  11. name = 'type',
  12. type = 'AudioType',
  13. default = [['playback']],
  14. description = 'The type of device to stop.'
  15. }
  16. },
  17. returns = {
  18. {
  19. name = 'stopped',
  20. type = 'boolean',
  21. description = 'Whether the device was successfully stopped.'
  22. }
  23. },
  24. notes = 'Switching devices with `lovr.audio.setDevice` will stop the existing one.',
  25. related = {
  26. 'lovr.audio.getDevices',
  27. 'lovr.audio.setDevice',
  28. 'lovr.audio.start',
  29. 'lovr.audio.isStarted'
  30. }
  31. }