Playing wave files sequentially issue

if I have it like this, it only plays the track I put there, the rest don't play

Have you run the App in Companion on your Smartphone? It may be a Google Drive thing, it hasn't necessarily been designed for streaming files. Try putting the files in the Media Tray and running them from there - if your files are .wav, convert them to .mp3 first, to reduce the size.

How it works:

  1. User taps button playBTN and the first music file is started
  2. When the first music file has finished, the Player Completed event is triggered
  3. The Player Completed event iterates the index number, used to select the next file from the list List_MusicFiles
  4. The selected music file is started
  5. Loops until all music files in the list have been played.

Search for "radio app" and "streaming" regarding Doze mode issues on Android 6+ devices.

I ran it on my mobile after scanning the output code
the files are some bigger than 4MB and won't upload, they are all mp3

That possibly explains the Google Drive thing too - takes time to buffer the file for streaming. However, you can store the music files in the App's ASD (App Specific Directory) or in a shared external directory, either /Download or /Documents - how that is done is Android Version specific:

It probably has something to do with google drive.
It starts playing the first one, if I keep the screen on it will continue to play the second one, if the screen goes off, it plays until the first track ends. It does not continue to play another track if the screen turns off.
If I press next, it will replay the first one, it won't go to next.
The pause and stop buttons work fine.
The next button does not.

... you could try stopping the screen from slipping into sleep mode:

Have not seen your code for the next button but it should use the List Index method I have already given an example of.

Sorry, I had it in the design but I didn't put it in the code because I can't find anything I can use for the next one. While for start, pause and stop I found

As I already said:

You should read my answers too.
You must use a Foreground service to prevent Doze mode.

We've discussed this issue countless times here & in the old AI2 forum and in all AI2-related forums. It's the only way.

Upload to what? Uploading them to the assets is of course possible as long as they don't exceed 30MB (or 50MB for the code... server).

... even with the MIT team.

Thanks a lot for your answers, being a complete newbie I have some jargons that I don't understand.
Tracks connected to google drive not all are playing, only 2 are playing.
I need to look into finding some that are smaller than 4MB to upload to the app.

No (the limt is 5MB), but as I said, no problem to add MP3s to the assets by using 7-Zip /WinRAR.

Ooohhh this is great information, many thanks for it

Now that I went to upload music files, apart from the fact that it limits files larger than 5 MB, it does not allow to create barcode if it exceeds 30 MB and if the MB is 29, it is stuck in the creation of barcode.
I think through google drive is better

Uploading the files to the app plays fine, except I had to reduce the number of tracks for it to create the bar code otherwise it would crash.

While via google drive while you can connect multiple music tracks, it only plays only one and rarely even 1-2 play and when the screen closes after the track that is playing does not continue with another one.
While the files are uploaded to the app, playback continues even with the screen off.

How to build a big app → APK max. 100 MB or → AAB 150 MB

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.