getDevice.lua 805 B

12345678910111213141516171819202122232425262728293031323334353637
  1. return {
  2. tag = 'devices',
  3. summary = 'Get the current audio device.',
  4. description = 'Returns information about the active playback or capture device.',
  5. arguments = {
  6. type = {
  7. type = 'AudioType',
  8. default = [['playback']],
  9. description = 'The type of device to query.'
  10. }
  11. },
  12. returns = {
  13. name = {
  14. type = 'string',
  15. description = 'The name of the device.'
  16. },
  17. id = {
  18. type = 'userdata',
  19. description = 'The opaque id of the device.'
  20. }
  21. },
  22. variants = {
  23. {
  24. arguments = { 'type' },
  25. returns = { 'name', 'id' }
  26. }
  27. },
  28. notes = [[
  29. If no device has been set yet, this function returns `nil`.
  30. The device doesn't need to be started.
  31. ]],
  32. related = {
  33. 'lovr.audio.getDevices',
  34. 'lovr.audio.setDevice'
  35. }
  36. }