how to stop a current playback?

Writing software that controls the system and peripherals such as displays, SD cards, Buttons, LEDs, Serial Ports etc.
Post Reply
HansNouwens
User
Posts: 5
Joined: Sat 2013-03-09 19:27

how to stop a current playback?

Post by HansNouwens »

Hello,

I want to control the VS100 module with UART. An other processor is sending commands like p1\n p2\n etc. I noticed that the response to my commands are different depending on the state of the player. A first p1\n command starts the sound, a second one (during playback) stops the sound, a second one after done starts the sound. Because the processor does not know how long the sounds will take this is a challenge.

Currently running v0.72-uart-queue-filemode, tried various things in different c files. No positive result so far.

How can I send play commands that are consistent? p1\n (or a new command) will always start (or restart) playing. It does not have to be gappless.

Thank you for the support.
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: how to stop a current playback?

Post by pasi »

In the playing mode of v0.72-uart-queue-filemode 'p' is a command to jump to the previous song.

'C' during playing cancels the playback.

You should be able to send "C\n" to make the play command work always the same way. While playing the 'C' will cancel playback, while not playing the newline will make sure the next play command starts from the start of an input line.

(If you only need to play from a uSD card, SDPlayerQueue090 has the same commands while playing than not playing.)
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
HansNouwens
User
Posts: 5
Joined: Sat 2013-03-09 19:27

Re: how to stop a current playback?

Post by HansNouwens »

SDPlayerQueue090 does the job almost as I like. The software is much easier to understand, I'll take this as a basis for my mods.

While experimenting with this version I found that a p1\n command indeed starts the sound again when playing. But when there are files queued the 1 is ignored and the next file is played. This can be prevented by giving a Rp1\n command, effectively clearing the queue first.

Thanks for your support!
Hans.
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: how to stop a current playback?

Post by pasi »

You're welcome.

SDPlayerQueue is also easier to modify and use and test because it is a single executable. Well, at least until it grows out of the instruction RAM...
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Post Reply