start.lua 894 B

1234567891011121314151617181920212223242526272829303132333435
  1. return {
  2. tag = 'devices',
  3. summary = 'Start an audio device.',
  4. description = [[
  5. Starts the active playback or capture device. This may fail if:
  6. - The device is already started
  7. - No device was initialized with `lovr.audio.setDevice`
  8. - Lack of `audiocapture` permission on Android (see `lovr.system.requestPermission`)
  9. - Some other problem accessing the audio device
  10. ]],
  11. arguments = {
  12. {
  13. name = 'type',
  14. type = 'AudioType',
  15. default = [['playback']],
  16. description = 'The type of device to start.'
  17. }
  18. },
  19. returns = {
  20. {
  21. name = 'started',
  22. type = 'boolean',
  23. description = 'Whether the device was successfully started.'
  24. }
  25. },
  26. related = {
  27. 'lovr.audio.getDevices',
  28. 'lovr.audio.setDevice',
  29. 'lovr.audio.stop',
  30. 'lovr.audio.isStarted',
  31. 'lovr.system.requestPermission',
  32. 'lovr.permission'
  33. }
  34. }