play for an duration of xx minutes and/or xx seconds

The duration must be customizable.
When a GPIO detect an leaf switch activation, Volumio must play music for the duration specified.
Thanks a lot for yours answers