SmartGPU2-LCD480X320Touch-CommandSet
SMART GPU 2 3.5” TOUCH
Command Set
Vizic Technologies ©2014 78
2.7.2 Play WAV File – 50hex - P ascii
Commands (host)
2 bytes + file name + 1byte(NULL)
1.- 0x41 (hex), A (ascii). *Audio Command.
2.- 0x50 (hex), P (ascii).
3 up to N (file name).
N+1.- 0x00 (hex) NULL ascii.
Responses (device)
2 bytes + 1 byte ACK/NAK
1.- File duration in seconds high byte.
2.- File duration in seconds low byte.
3.- 0x4F (hex), O (ascii) – success ACK or
0x46 (hex), F (ascii) – fail NAK.
Description
When this command is sent and successfully
executed(ACK ‘O’ received) a Wav file stored in the
microSD card will begin playing audio on the
AL(Audio Left channel) and AR(Audio Right channel),
it’s highly recommended to place two 100uF-400uF
capacitors in each output to decouple output
voltage(refer to datasheet for recommended circuitry).
The SmartGPU 2 automatically will read and
sample the audio file(22100Hz, 44100Hz, etc.)
according to the WAV header file. If the file is MONO,
both channels will have the same output, if file is
STEREO, channels will have different output.
The response of this command is very useful as
once the audio file begins playing, user can know the
total file duration in seconds or the time that the
SmartGPU 2 will be playing the audio file.
The file will continue playing until it finish, user can
send any other command meanwhile the audio file is
being played. If this same “Play WAV File” command
is sent while the SmartGPU 2 is already playing
audio, command will be just ignored(NAK) and audio
will continue playing.
The file name must be up to 250 characters. Only
numbers and letters are recommended to name
the file, some special characters are not allowed
and may not work.
Always a NULL character (0x00)hex must follow the
last character of the file name, in order to indicate to
SMART GPU the end of this file name, the name to
receive must not include the .wav extension.