Ciao a tutti, avrei bisogno di creare un app timer ciclica. Praticamente devo mettere due registrazioni che una volta lanciata l'app ad un orario preciso riproduca la registrazione indicata.
Sto provando ma credo di sbagliare qualche logica durante la creazione perché non riesco ad inserire l'ora di riproduzione. Se avete idee grazie
Show what you have tried so far (your blocks).
See also here:
Describe precisely which steps should be taken and when:
- Start recording
- Stop rec
- Play at time (after mm:ss ...?)
- ...
- ..
And use English blocks:
The control I need are:
- button play the "program"
- play "audio 1" at time 10.30
- play " audio 2" at time 11.30
- play " audio1" at time 12.30
- play " audio2" at time 13.30
And go in this way all the time I need
Ad one button for stop
This is a table search problem (I won't deal with keeping your app alive.)
Keep a reference table of your music start times and file names, in ascending time order, with HH:mm formatted times, like in your sample.
Bring in a Clock from the Sensors drawer, and rig it to run a Timer once a minute.
Every minute, loop through the table and test each start time against the current time.
If the start time is less than or equal the current time, save it in a global variable (default "00:00")
After the loop is done, that variable should have the start time for the current song.
Use the lookup in pairs list block to get the file name for the current song.
Compare the current song from the table to the Player component's song. If they match, do nothing. If they don't match, stop the current playing song, load the new song, and start it playing.
Duration of audio1 and audio2 ?