CFSound III RS-232 Control Example Uses


Picture of CFSound III Connected to CPU For computer, PLC(Programmable Logic Controller), or microprocessor controlled products or equipment, there's an on board RS-232 port.  A simple ASCII protocol allows playing, stopping, and queuing of audio files.  Now how simple is that!  You have a product, it looks great, runs great, but it sure would be great if played audio.  Now it can.  You can simply play individual audio files, and or queue them for play out in a specified/queued order.  With a library of audio files(words, sounds) you can queue together very complicated audio sequences very simply!

Sound play-out may also be controlled via commands received via the serial port. The data format is 2400 baud, 8 data bits and 1 stop bit.

Playing Sounds
Sounds may be started, queued and stopped using a simple ASCII protocol:

SOH p {+/-/&/~/!} XX ETX

where:
SOH = ASCII Start of Header character 01 (Ctrl-A)
p = ASCII lower case letter p for the play command
{+/-} = ASCII plus character + to start a sound, minus character - to stop a sound {&/~/!} = ASCII ampersand character & to queue a sound, tilde character ~ to flush the queued sounds, exclamation character ! to stop the current playing sound and flush the queued sounds
XX = ASCII two digit hexadecimal number XX of the sound (01,02, . . . , 7E, 7F)
ETX = ASCII End of Text character 03 (Ctrl-C)

Up to 128 sounds may be queued. Sounds that are queued are played in succession in the order that they were queued only when no other sound is playing until the queue is exhausted or flushed. Note that this can occur at the end of the current background sound file before it repeats. A background or other sound that is playing may be stopped by issuing a p-00 serial command sequence to allow queued sounds to be heard. The background sound will be resumed when the queue has emptied.

Volume Control
Sound volume may also be controlled via commands received via the serial port. The volume is essentially db linear in sixty-four, 1db increments from -66db (value of 0) 0db (value of 63). The current volume level is remembered in non-volatile memory on the CFSound-III and is restored to it s last setting upon power-up. Sound volume may be set, increased or decreased using a simple ASCII protocol:

SOH v{=/+/-/<} XX ETX
where:
SOH = ASCII Start of Header character 01 (Ctrl-A)
v = ASCII lower case letter v for the volume command
{=/+/-} = = ASCII equals character = to set the volume to the absolute value XX {+/-} = ASCII plus character + to increase the volume by XX, minus character - to decrease the volume by XX {<} = ASCII less than < to fade the volume to 0 over XX seconds
XX = XX = ASCII two digit hexadecimal value XX16 of the volume modification (00, 01, . . . , 3E, 3F) = (0 63))
ETX = ASCII End of Text character 03 (Ctrl-C)

Amplifier Control
The speaker amplifier may also be muted via commands received via the serial port. Muting does not affect the current volume setting and is automatically cleared whenever the CFSound is Reset. The speaker amplifier may be muted / un-muted using a simple ASCII protocol:

SOH a {+/-} ETX
where:
SOH = ASCII Start of Header character 01 (Ctrl-A)
a = ASCII lower case letter a for the Amplifier command
{+/-} = ASCII plus character + to un-mute the speaker amplifier,minus character - to mute the speaker amplifier
ETX = ASCII End of Text character 03 (Ctrl-C)


Return to CFSound III Examples Page


Home
Ackerman Computer Sciences
6233 East Sawgrass Road
Sarasota, Florida 34240-8922
Phone (941)377-5775 -- Fax (941)378-4226

Copyright© 1992 - 2008 ACS, Sarasota, FL. All rights reserved. Windows TM is a trademark of the Microsoft Corporation. All other brand names or product names are or may be the trademarks or registered trademarks of their respective companies.


Last Updated 02/19/08