How to stop display from turning off after X minutes

I have a macOS audio editing app in development and when the composition is played but the user does not interact, the screen will dim and then turn off after the number of minutes selected in System Settings. This is not desirable.

Is there any programmatic way to disable this while doing a particular operation or do I have to fake it by drawing something invisible on the screen on a timer while playback is in progress?