I want to set a music which is longer than 30sec as notification soound. But after searching about this I came to know that it is not possible to add these type of music as notification sound. notification sound must be in 30sec longer otherwise it will not play music. Now how can I add more than 30sec longer music as notification sound?
Asked
Active
Viewed 78 times
0
-
Your research is correct, you can not play a sound longer than 30sec. – rckoenes May 24 '17 at 12:38
-
Then what should I use for longer music like alarm? – sazid008 May 24 '17 at 13:03
-
You don't, there is no suchs option for developers. – rckoenes May 24 '17 at 13:04
-
I used 29 sec .mp3 file but it doesn't play full music. It only play music when the notification pop up show. After that pop up go the music also stop playing what to do with it. @rckoenes – sazid008 Jun 01 '17 at 04:42
1 Answers
0
I had a similar issue for my alarm app as well. What I did was a workaround when your app is in background. You play a music file in your code in background and increase the volume of the device to maximum. You can play as much longer music file as you want. Stop playing the music when someone clicks on the notification.
The only problem with this is that your app should not be killed or terminated.

Swati
- 1,417
- 1
- 15
- 35