Run voice commands like "Play", "Pause", "Next" on Spotify with Tasker and AutoVoice?
You should try using AutoInput, a plugin for Tasker available in the market, which doesn't require root.

You can then create a profile and set AutoVoice for every command, then set AutoInput (plugin section) with the X and Y coordinates of the button you want to press. Find the coordinates of the button by enabling the feature in Developer Options.

N.B. Make sure you're in the app you want when running the task.

Hope it helped!