stop.lua 838 B

123456789101112131415161718192021222324252627282930313233343536
  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. type = {
  11. type = 'AudioType',
  12. default = [['playback']],
  13. description = 'The type of device to stop.'
  14. }
  15. },
  16. returns = {
  17. stopped = {
  18. type = 'boolean',
  19. description = 'Whether the device was successfully stopped.'
  20. }
  21. },
  22. variants = {
  23. {
  24. arguments = { 'type' },
  25. returns = { 'stopped' }
  26. }
  27. },
  28. notes = 'Switching devices with `lovr.audio.setDevice` will stop the existing one.',
  29. related = {
  30. 'lovr.audio.getDevices',
  31. 'lovr.audio.setDevice',
  32. 'lovr.audio.start',
  33. 'lovr.audio.isStarted'
  34. }
  35. }