Adverts is a new program for VS1005 / VSOS that is intended for a system that plays advertisements over background music. Both the background music and the ads can be conveniently put on an SD card. Adverts can play these files in a timed fashion, either in alphabetical order or through shuffle play. Alternatively a UART interface can be used either manually, or using a microcontroller.
To test Adverts, download the link provided at the end of this message, as well as the example SD Card files, located at:
Then follow the README.TXT file provided in the package.
I have attached a short MP3 audio clip called AdvertsExample.mp3 to demonstrate how the systems sounds when it is running. As you can hear, Adverts can play two independent audio streams at the same time: the almost muted background audio, as well as the advertisement audio in front of it.
The README.TXT instruction file for Adverts, also included in the package, is repeated here for your convenience:
This is the very first release of Adverts, so feedback and suggestions would be very much appreciated.
Code: Select all
Adverts 1.00 - Repeat Player with Adverts option ------------------------------------------------ for VSOS 3.57 or higher 2019-06-13 VLSI Solution Adverts is an example of an MP3 player that fades the music out to play short messages, e.g. advertisements, at the same time as the background music. It can be controlled through a command line interface, Buttons S1 and S2 on the VS1005 Developer Board, or through the UART. When an advertisement file is to be played, the main music is first faded out by 24 dB, then after the advertisement file has ended, the main music is faded back in. For options, run: S:>adverts -h Usage: Adverts [-v|+v|-p|+p|-s|+s|-r|+r|-tx|-h] -v|+v Verbose|Not verbose -p|+p Start in pause|play mode -s|+s Shuffle mode for music on|off +r|-r Shuffle mode for adverts on|off -tx Play adverts at x second interval. 0 = off -h Show this help To use, either compile the VSIDE Solution, or simply copy Adverts.dl3 of this package to your VS1005 Evaluation Board's SYS/ folder. Before you start Adverts, you need to have music MP3 files in the folder D:MUSIC, and RIFF WAV advertisement files in the folder D:ADS (D: is typically the SD card). Supported file formats are: - D:MUSIC MP3 up to 48 kHz, 320 kbit/s. Up to 1000 songs in this folder are supported. - D:ADS RIFF WAV 8/16-bit PCM up to 48 kHz stereo or up to 32-bit mono. There are no guarantees for files with larger sample rates or bit depths. Up to 1000 advert files in this folder are supported. An example SD Card image containing example MUSIC and ADS folders can be downloaded from: http://www.vlsi.fi/support_data/AdvertsSdCardImage.zip An audio example of how the sounds while working can be downloaded from: http://www.vlsi.fi/support_data/AdvertsExample.mp3 Example 1 plays background music in shuffle mode. On top of that it will play an advert in shuffle mode once every 60 seconds: S:>Adverts -s -r -t60 Example 2 plays background music in alphabetical order. Adverts have to be activated through UART: S:>Adverts UART commands: - q Quit Adverts - > Turn music output 1/2 dB louder - < Turn music output 1/2 dB softer - n Next song. If in shuffle mode, and last song has been played, reshuffle the shuffle list. - p Previous song. If in shuffle mode, and first song has been played, reshuffle the shuffle list. - N Next advert. If in shuffle mode, and last advert has been played, reshuffle the shuffle list. - P Previous advert. If in shuffle mode, and first advert has been played, reshuffle the shuffle list. - SPACE Pause/Unpause music playback. - . Jump 10 seconds forward in music. - : Jump 60 seconds forward in music. - , Jump 10 seconds backwards in music. - ; Jump 60 seconds backwards in music. - ~0308=x (x<=1000) Play song number x. Will turn music shuffle mode off. Example: ~0308=4 plays song number 4, if available. - ~0308=x (x>=1001) Play advert number x-1000. Will turn ad shuffle mode off. Example: ~0308=1004 plays advert number 4, if available. VS1005 DevBoard button commands: S1 - Same as 'N' on UART. S2 - Same as 'P' on UART. Example config.txt for Adverts application:  # Default configuration, no buttons pressed during boot. # Sets up clock, audio drivers etc, then goes to Adverts. # # Set clock to a higher value so that Adverts functions reliably. RUN SETCLOCK -l93 86 # Start UART in/out driver UARTIN # Start SD card as device D SDSD D # Audio DAC out driver AUODAC s # Enough buffer for Adverts to work without glitches RUN AUOUTPUT -s4096 # Starts Adverts RUN ADVERTS # Drop to shell in case Adverts is stopped S:SHELL.AP3 License: This code may be used freely in any product containing one or more ICs by VLSI Solution. Disclaimer: No guarantee is given for the usability of this code. Version History: 2019-06-13 HH v1.00 - First release.