April 28, 2024, 04:00:38 AM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


SD Card and Encoding Tips

Started by JonnyMac, October 21, 2013, 01:46:31 PM

Previous topic - Next topic

JonnyMac

October 21, 2013, 01:46:31 PM Last Edit: October 21, 2013, 01:48:37 PM by JonnyMac
Tip 1: Not all SD cards are equal (in quality). In fact, there's an SD Card Association and a vendor must be part of that association, and abide by its rules, to put the SD card logo their product. You should only use cards with an official SD logo.

Tip 2: Not all SD cards are equal (in speed). A properly manufactured card (see #1) will also have a speed rating  (a C with a number in it marked on the card). The higher the number, the faster one can move data to and from the card. For audio, we suggest a Class 4 card or higher.

This image shows a popular SD card that works very well in our AP-16+. Note the SD card logo and speed rating are clearly marked.




What many people don't realize is that an SD card is actually "smart" media; it's not just a magnetic storage device like an old floppy disc. What this means is that the host (computer or audio player) has to "talk" to the SD card controller to get data from it, or store data on it.

When it comes to audio for props and displays, we can help the SD card in two ways:

Tip 3: Reduce the sample rate from 44.1kHz to 32kHz. Here's the reason: normal human hearing is only up to about 15kHz -- and that's only in people with really good hearing. Even at that, responsiveness to high frequency sounds is much less than lower frequencies. With a 32kHz sample rate we can reproduce a 16kHz sound. By reducing the sample rate to 32kHz we reduce the data throughput by about 27.5% -- this can make a big difference in the performance of some low-cost SD cards, and you won't be able to hear the difference between the sample rates.

Tip 4: If the sound doesn't have to be stereo, then make it mono -- this will cut the data throughput by 50%

Note: the throughput numbers are specifically for WAV files, but these modifications affect encoded files like MP3s as well.


Our favorite audio editor is Audacity. To change the sample rate of the file, simple select it in the drop-down box located in the lower left-hand corner of the screen. The file will be re-encoded on the next export. If you wish to test the new sample rate before exporting the file, use Tracks -> Resample.

Here's an example file: a monster sound from a monster-in-the-box prop. Note that the original file is stereo, 44.1kHz. Chances are only one speaker is used -- as you can see, both channels contain the same data.




Open the track menu by clicking on the little black triangle in the header; select Split Stereo to Mono. This process will create two mono tracks from the original stereo track. Delete the second by clicking the X in the track header.




Finally, set the new sample rate to 32000 (32kHz) before exporting.




Tip 5: For small audio players (from any manufacturer) it's a good idea to remove the non-audio metadata from the file. In Audacity you can use File -> Edit Metadata to open the metadata dialog, then press the Clear button to remove all non-audio information from the file.


Review:
  -- use SD cards with official logo
  -- use SD cards with a speed rating of 4 or greater
  -- reduce sample rate of file to 32kHz
  -- use mono file if possible
  -- remove metadata from file before exporting
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

For those wondering why I split the file to mono before changing the sample rate -- this was done just to save Audacity a little work. The order doesn't matter, but there's no need to re-sample two channels when we're only going to use one.
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

Thanks, Jon, for this tutorial. As always, EFX-TEK really tries to help their customers with their projects!
Shawn
Scaring someone with a prop you built -- priceless!

bsnut

Quote from: livinlowe on October 21, 2013, 03:00:20 PM
Thanks, Jon, for this tutorial. As always, EFX-TEK really tries to help their customers with their projects!
Yes, I have to agree another great tutorial as normal.
William Stefan
The Basic Stamp Nut

JonnyMac

Thanks, guys.

BTW... for those wondering about the size reduction of my demo: The original (stereo, 44.1kHz) file is 1,766,380 bytes. The mono, 32kHz version is 640,892 bytes (36% of the original) -- and I would challenge anyone to detect an audible difference between the two files, especially when used in the context of a monster-in-the-box prop.
Jon McPhalen
EFX-TEK Hollywood Office