start.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. return {
  2. tag = 'devices',
  3. summary = 'Start an audio device.',
  4. description = [[
  5. Starts the active playback or capture device. By default the playback device is initialized
  6. and started, but this can be controlled using the `t.audio.start` flag in `lovr.conf`.
  7. ]],
  8. arguments = {
  9. type = {
  10. type = 'AudioType',
  11. default = [['playback']],
  12. description = 'The type of device to start.'
  13. }
  14. },
  15. returns = {
  16. started = {
  17. type = 'boolean',
  18. description = 'Whether the device was successfully started.'
  19. }
  20. },
  21. variants = {
  22. {
  23. arguments = { 'type' },
  24. returns = { 'started' }
  25. }
  26. },
  27. notes = [[
  28. Starting an audio device may fail if:
  29. - The device is already started
  30. - No device was initialized with `lovr.audio.setDevice`
  31. - Lack of `audiocapture` permission on Android (see `lovr.system.requestPermission`)
  32. - Some other problem accessing the audio device
  33. ]],
  34. related = {
  35. 'lovr.audio.getDevices',
  36. 'lovr.audio.setDevice',
  37. 'lovr.audio.stop',
  38. 'lovr.audio.isStarted',
  39. 'lovr.system.requestPermission',
  40. 'lovr.permission'
  41. }
  42. }