There are many ways. I am assuming you are looking for a solution to the question of how to do it in something you are building, rather than just general background information on how it is done in the electronics industry? If so, here is some specific ways it can be done:
The most common these days, of course, is to convert the music to .MP3 format, store it in flash memory or on a small hard drive, and use an MP3 player chip to play it back. That is what an iPod and other MP3 players are doing.
There are even completely integrated little boards designed for use with the BASIC Stamp processors to handle recording and playback of .MP3 files for you in your own projects. Take a look at this one for example:
http://www.tetraphon.com/docs/QV606m1t1.pdf
It is controlled by standard serial communications, such as those from a COM port, the TxD line of a standard microcontroller, or the BASIC Stamp's SEROUT commands.
Another way to put sounds into hobbyist circuits is to use the ISD line of "ChipCorder" devices which are being produced by WinBond. They don't have the storage capacity (playback time) of the .MP3 players, but they are cheap and easy to work with. A small one that can store about 12 seconds of sound is carried at Radio Shack, and larger ones are available online. These were designed to act as solid-state tape recorders with multiple messages, so control is by discrete logic lines for record, play, skip, stop, and so on. The more advanced ones can also be controlled using SPI serial interfaces. Here is a link to the manufacturer's website:
http://www.winbond-usa.com/mambo/content/view/36/140/
- - - - - - - - - - -
The above approaches are fine for hobby experimenters but too expensive for mass manufacture. In mass manufacture of electronic items, one of the following approaches is usally used:
For low-cost designs such as toys, it will depend on if you want ONLY music, or if you want sound effects and voices and such as well.
For only music, the music is normally rendered into MIDI form and played on dedicated low-cost MIDI playback processors. In a low-cost MIDI processor, there are short recordings of each instrumant playing different notes, and the data for which note to be played when (think of this as electronic sheet music) is stored in a memory to control the playing of the music. Once the basic sound of each instrument is stored, the actual MIDI "sheet music" only takes up a few bytes per second so it is very easily stored even in chips with only a small amount of memory.
For designs that need sound effects, voices, and so on the sound to be played back is first recorded as a standard .WAV file on a computer. It is then carefully filtered and processed using programs similar to CoolEdit or Goldwave in order to give it the best possible sound when played back at a rate of about a 6KHz - 10KHz. This resulting .WAV file is much smaller than the original -- normally only about 1/10th the size of the original. It is then compressed into ADPCM format which reduces it another 2:1 in size, and this file is stored in the on-board memory of the microcontroller. When the file is played back through the microcontroller DAC output and the resulting voltages used to drive a speaker, it produces sound. ADPCM requires about 4K bytes of memory per second of sound and if you process the source files it can sound quite good for a system that requires only a very simple processor.
Finally, to get even more sound stored, you go to the more exotic solutions such as .MP3 -- these require a much more powerful processor to decode the data and reproduce the sound, and usually require a desktop or laptop class computer to encode the sound into compressed form, but the advantage is that you can get 20:1 compression ratio over the original .WAV file and still have excellent sound (this is what most .MP3 files played on your computer are). You can also go to much higher compression ratios and still sound better than ADPCM. You can manage to store a full second of sound in as little as about 2000 bytes per second using .MP3 and still have it sound almost indistinguishable from the original huge .WAV file.
2006-12-12 06:29:36
·
answer #1
·
answered by Mustela Frenata 5
·
0⤊
0⤋
Divide the waveform into frames, approximate the waveform in each frame with a multi-order polynomial, store the constants used to create the polynomial as frame data.
Oh yeah, that's already been done (mp3).
2006-12-12 06:28:11
·
answer #2
·
answered by www.HaysEngineering.com 4
·
0⤊
0⤋
In simplest form, digitise the music and store the digits.
2006-12-12 09:23:11
·
answer #3
·
answered by minootoo 7
·
0⤊
0⤋
same way we store pictures,,,by codes
2006-12-12 06:29:32
·
answer #4
·
answered by rebel 1
·
0⤊
0⤋