Audio commands

From ThaiEasyElecWiki
Jump to: navigation, search

VSAudioCmd() is a utility function concerning with audio files playback. It includes simple play and stop functions, play next file in the folder and so on. This function can be accessed manually through command line interface with command “audio” (see more detail at the bottom of this page).

VSAudioCmd(char cmd, unsigned char para) 


As seen, the function needs 2 parameters, the first is command type accepts only upper case letters. The available command types are:


‘N’ : refers to ‘next’ means to stop the playing audio file and start playing next file in the same folder. If the current file is the last one, the folder will be reopened and the first file will be played. This command discards the second parameter.


‘S’ : refers to ‘stop’ means to stop playing the file. This command discards the second parameter.


‘J’ : refers to ‘jump’ means to jump to the specific part of the audio file. This command uses the second parameter in range of 0-99 in term of percent.


‘P’ : refers to ‘pause’ means to temporary pause the playing file. Use in companion with command type ‘C’ to continue. This command discards the second parameter.


‘C’ : refers to ‘continue’ means to continue from ‘pause’ state. This command discards the second parameter.


‘M’ : refers to ‘mute’ means to disable the sound from VS1011. Use in companion with command type ‘L’,’U’,‘D’ or ‘V’ to enable the sound. This command discards the second parameter.


‘L’ : refers to ‘loud’ means to enable VS1011’s sound with the old set value. This command discards the second parameter.


‘U’ : refers to ‘up’ means to increase the volume 5 percents. This command discards the second parameter.


‘D’ : refers to ‘down’ means to decrease the volume 5 percents. This command discards the second parameter.


‘V’ : refers to ‘volume’ means to set the volume with the second parameter in term of percent.


With command line interface, while an audio file is running, the user can use ‘audio’ command to access VSAudioCmd() function. The command needs one character (all characters will be transformed to upper case) and if the character is ‘J’ or ‘V’, it needs one another numeric parameter as described above.

For example (on Hyperterminal),

audio p //pause

audio c //continue

audio j 60 //jump to 60/100 of the whole file
Personal tools
Namespaces
Variants
Actions
Navigation
Articles and Tutorials
Shortcut (mini SUN7)
Toolbox