Sound Capabilities
simontemplar
Posts: 2
I'm wanting to use the Propeller Activity Board to make sound and light effects for my train layout. Would I be able to have an ambient sound effect loop play and at the same time trigger a lightning sound to play over it as an LED flashes?
Is the Propeller fast enough to trigger the lightning sound and light at the same time?
How many sound clips can I play at the same time?
Is there a maximum length for the sound files?
Is the Propeller fast enough to trigger the lightning sound and light at the same time?
How many sound clips can I play at the same time?
Is there a maximum length for the sound files?
Comments
Yes.
One. There is not enough bandwidth to have more than one audio file open, and it takes three of four cogs to play a WAV file (that includes the SD card access)
As long as the file size is 2G or less you're fine. I would suggest using mono files that are encoded to 32KHz -- this will reduce the size of the file and help with the SD access (don't use cheap uSD cards, you'll be sorry).
I've attached an audio demo that uses my driver and runs on the Activity Board. You'll need to put a WAV file on the SD card and change the filename in the demo. This shows you how to access the audio driver. When the audio is playing you're free to do other things, and you can check the driver status with the playing() method. I helped Disneyland create a little hand-stamper for the Buzz Lightyear character that used this driver and a little PWM driver for LEDs. The light shows were embedded right into the code, and played at the same time the audio played.
Mine isn't the only one. A forum regular, Kye, has a new audio driver that many are saying is quite good (I haven't tried it yet).
Tips:
-- If you're not using Audacity, download it and learn the basics
-- It is great for converting any format to WAV -- which you need to do for Propeller players
-- It is great for stripping meta data out of the file (my driver stops at meta data (I don't know how Kye's driver responds)
By the way, I designed my driver for this product (which was designed by me and another former Parallax employee):
-- http://www.parallax.com/product/31316
...which is used by Disneyland, Legoland, dozens of museums, and hundreds of haunted houses and other attractions across the country.