[SOLVE] Play an audio file for a certain time

I run an asterisk where people are taxe for the duration of their call and get a code a the end.
For exemple 1min = 0.5 € , 2min = 0.75 etc…
So while they are “waiting” i play some music file but for some solution i will need 30sc of music , for other 42 sc … So everytime i have to cut my music file and make a new file for every duration.
The idea is to play always the SAME audiofile but to stop after a certain time passed in parameter. Something like Playback(“myfile”,for 32sc);
Does anything like this exist already, right in asterisk?
If not do you have any clues about doing it in AGI writen in PHP?
Thank’s a lot for your answers !

did You try Music On Hold ?
Enable music and wait N seconds.

Sorry i browse my doc and i saw a function called WaitMusicOnHold that allow to play music on hold for an among of second !
thanks anyway!