A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Unable to import mp3 file

  1. #1
    Member
    Join Date
    Jul 2001
    Posts
    33

    Cool

    I have noticed that some mp3 files won't import to flash, it will give me the following error "One or more files were not imported because there were problems reading them" do any of you know why this happens and/or is there a way around this problem? Thanks for your time and assistance.

  2. #2
    Senior Member
    Join Date
    May 2001
    Posts
    354
    The file could be corrupt. You can try to make your own mp3 from the original mp3. Try this: go to http://www.goldwave.com Download the goldwave programe. Then get the "lame" plugin for goldwave. All found at the same page. Then use the programe to open the mp3 then save it as a new mp3 file. If that doesnt work play the mp3 and record it in goldwave using the record audio out option and save the file as an mp3.

  3. #3
    it's a good thing to make a new wav file of a good quality (44100,16,stereo ), so you'll have to re-encode it in .mp3 format but select a bitrate that is supported by flash(not more than 160);

  4. #4
    Member
    Join Date
    Jul 2001
    Posts
    33
    Thank you both for your responses I will try to do what you guys suggested and see if that works, thanks again.


  5. #5
    Junior Member
    Join Date
    Aug 2000
    Posts
    17
    It’s got to be some sort of bug. I am having the same problem with wav’s. There is nothing wrong with the file it opens and plays fine in my player. I can save the file as a new file and still the same error "One or more files were not imported because there were problems reading them"

  6. #6
    Junior Member
    Join Date
    Aug 2000
    Posts
    17

    attempting to Import the wav file it corrupts the file

    Well, I downloaded Goldwave and opened the file then resaved it and it finally imported. When opening the file in Goldwave I got an error, the error said, “Wave file RIFF chunk size is incorrect”. Here is the funky thing. If I didn’t attempt to import a wav file into Flash 5 first, I could open the file in Goldwave and I would not get the error. Possibly when attempting to Import the wav file it corrupts the file??? I’m not sure. I figured I would pass this along for anyone else who is having this problem.

  7. #7
    Member
    Join Date
    Jul 2001
    Posts
    33

    Smile

    I got it working thanks to the comments and solutions given by you guys.

  8. #8
    Member
    Join Date
    Jul 2000
    Location
    Brisvagas, Australia
    Posts
    64

    mp3 dosn't import

    Hello everyone... I've been having the same problems trying to import mp3 files into flash... What I have is to mp3 files the first @ 44hz and a file size of 3,714kb and the other @ 8hz and that file size is 232kb, now both the files are 16bit... The problem is the 44hz 3,714kb imports fine and the smaller 8hz 232kb dosn't import into flash 5 at all... WHY???

    PLEASE HELP!!!

  9. #9
    Senior Moderator ®
    FK´s Banning Machine ™
    GMF ™'s Avatar
    Join Date
    Feb 2000
    Location
    Oslo, Norway
    Posts
    5,697

    Something you all should read :)

    How can I get the best sound quality?

    In order to get the best quality sound for the smallest file size and performance hit, you must consider what the content of the sound is. Too often, movies use a blanket 8-bit 22kHz sound format when that may not be appropriate. But first, you must realize what each factor means when recording sound.

    First, sound recorded in a computer is digital. This means that a replica of the sound is being recorded as opposed to analog which makes an actul copy of the sound wave. As a developer, you need to be aware of two crucial elements and how they affect your piece.

    Bit depth - This is the detail of any particular sample. The higher the bit depth, the more detail each sample has of the sound. This gives greater accuracy and, more importantly, less noise.
    Sampling rate - The number is measured in kHz, but is actually the number of times per second that the sound is sampled. At each of those intervals, that particular place in the sound is recorded. A sample is taken
    So a sound recorded at 16 bits and 44.1 kHz is actually a sound that has been sampled 44,100 times per second and each sample has a bit depth of 16 bits.

    Bit Depth

    Bit depth is the detail of the sound samples. The higher bit depth, the more detail and less room for noise or muddiness. Sounds recorded at 8 bit typically have more noise (hiss) than sounds recorded at 16 bit. If you are recording voice alone, there will be gaps and pauses between words and sentences which can accentuate any noise in your sound. Generally, a higher bit depth is recommended for voice in order to keep your sound "clean".

    Sampling Rate

    Sampling rate is a bit more complex. You need to consider what your needs are. Keep in mind that the human ear can hear things in a range of approximately 20-20,000Hz. Anything above 20,000kHz cannot be heard by humans (while sounds below 20Hz cannot be heard per se, they can be felt assuming that your sound system can output at that frequency). A range of 20 - 20,000Hz is the general rule of thumb although this can vary somewhat among individuals.

    Nyquist's Theorem says that you need to record your sound at a sampling rate of double that of the dynamic range you are trying to achieve. If you want your sound to have a range of 20 - 20,000kHz, then you need to record it with a sampling rate of at least 40,000Hz. A sampling rate of 44.1kHz is commonly used to achieve a full dynamic range - CD audio quailty.

    What it all means

    Now that you've had a crash course in digital audio, you need to apply it to your piece. File size and quality are important. While it is easy to assign a blanket bit depth and sampling rate to all of your sounds, your sound quality might not benefit from this strategy. Instead, weigh the differences each provides.

    Voice - For voice, a higher bit depth to eliminate hiss and muddiness is preferable to achieve a clean sound. But 16-bit audio files are twice as large as comparable 8-bit sound files. You can usually make the tradeoff in sampling rate, by cutting it down. Recording voice does not require the same frequency range as music. There is no booming bass or higher highs. The human voice is pretty much mid-range. So if you establish that the frequency range does not need to go any higher than 5,000Hz, Nyquist's Theorem says to record the sound with a sampling rate of 11kHz. If your talent has a deeper voice or tends to fluctuate in range, then a range of 11kHz can be achieved by recording at 22kHz. Keep in mind that this will double your file size.

    Music - For better sounding music, the bit depth is not as important as the sampling rate. Since music is continuous with no noticeable pauses or gaps similar to what you'd find in voice, hiss and muddiness can often be masked by the nature of the sound. So a lower depth of 8 bit can sound nearly as good as 16 bit, but without the doubled file size. Since most music has a wide dynamic range, then the sound needs to be recorded with this in mind. A lower bit depth such as 11kHz will produce a very flat, undynamic sound, not unlike that coming out of a transistor radio. The highs will be cut off and the bass will be nonexistant or even distorted. 44kHz is CD audio quality and sounds quite good on a good system. But the file size is quadruple that of a sound recorded at 11kHz and most computer systems have small speakers that can't generate the quality you are looiking for. So a happy medium is 22kHz. This is radio quality which is good for applications most of the time.

    Summary

    For voice, focus on bit depth to reduce noise, hiss, and muddiness. Sampling rate is usually a secondary concern. For music, focus on sampling rate since the nature of music can mask the degradation of a lower bit depth.

    Things to Consider

    File size is always halved if you cut the bit depth or sampling rate in half. In other words, you won't get a smaller file by cutting the bit depth in half than you would if you cut the sampling rate in half. You will get the half the size of the original regardless of which one you cut.
    An 8-bit 44.1kHz sound is the same size as a 16-bit 22.050kHz sound.
    A 16-bit 11.025 kHz sound is the same size as an 8-bit 44.1kHz sound
    Most people don't have sound systems on their computers that can pump out a 16-bit 44kHz sound the way you want them to hear it. Unless you know your target audience has this capability, there is no sense in doing it.
    File size is not the only thing to consider when chopping sounds. Performance is also affected by bit depth and sampling rate. As expected, higher bit depths and sampling rates require more system resources to process, possibly degrading the performance of other elements in the piece. So if your animation speed is crucial at that moment, consider dropping the sound quality.
    Director for windows has one sound channel. We employ macromix.dll to mix Director's 8 sound channels into one. But if you try to mix sounds of different bit depths, two performance hits can result:
    The sounds will be resampled to match each other. A 44kHz sound may suddenly have the same range as the 11kHx sound you are trying to play at the same time.
    Due to the time it takes to mix the sounds, there can be a noticeable delay bertween the time the command to play the sound is issued and when it actually begins to play.
    For more information specifically regarding this issue, please see TechNote 3191, Windows and Multichannel Sound.
    For purposes of simplicity, sampling rates in this techNote are referred to in their simplest values such as 44kHz. This is not entirely accurate and to keep things standard for the widest compatibility across different sound cards, you should limit yourself to the following sample rates:
    44.1kHz
    22.050kHz
    11.025kHz
    Any variation from these sample rates can produce unexpected results and may not be comptible with Director's import filters.






    Digital resolution

    It used to be that to store such an enormous amount of information, you'd need the long spiral of a vinyl disk (raise your hand if you remember LPs) or miles upon miles of magnetic tape. Such a recording method is called analog, because the LP turns under the needle (or the tape moves past the head) at a rate analogous, or equal to, the sampling rate. If you've ever slowed down or sped up a tape player, you've experienced analog sound out of synch with the sampling rate.

    As technology advanced enough to make storing large amounts of data economical, it became practical to record sound digitally. Every sampling of sound is attributed a digital value. If the range from quiet to loud was divvied-up into 16 levels, for instance, you would have 4-bit sound (each sampling would have one of the 16 binary values from 0000 to 1111. Think "walkie-talkie").

    As digital data goes, digital sound is very much like digital imagery. Sampling rate is very much like pixel resolution. As a denser array of pixels can increase the clarity of a digital image, so too can a denser sampling rate increase the fidelity of digital sound. Imagine a 300 dots-per-inch (DPI) image and how much more information it provides relative to a 72 DPI image. The same goes for sampling rate. While a music CD reproduces sound with a resolution of 44.1 kHz, the standard computer sound is produced with a density of only one-fourth that (11.025 kHz).

    The sophistication, or depth, of each byte of digital information is relevant as well. GIFs possess the 256 values of 8-bit data, but often JPEGs have the color depth of 24-bit data (224 or "millions" of colors). Likewise, digital audio can have the refined tone of 16-bit data or the more bland, "greyscale" tone of 8-bit data. (Human ears, by the way, hear the equivalent of 24-bit sound).

    As you may already know, with digital bitmap imagery, more and deeper pixels make for bigger and fatter files. Once again, the same goes for digital sound. Sound, however, has the unique predicament of having to be delivered at a sustained rate because it eventually has to go analog again when it hits the speakers. While a 300 DPI, 24-bit JPEG just takes longer for a computer to buffer and then display to the screen, full-fledged sound taxes the very infrastructure of computer networks with its constant, streaming delivery from disk driveto speaker. If you have ever had occasion to watch the painfully slow draw of a large JPEG, then just imagine if it were an orchestral maneuver.

    Note: The compromise of digital quality for file size is as true for sound as it is for imagery. Sometimes an 8-bit GIF is an acceptable alternative to a 24-bit JPEG. For the same reason, it just makes sense to use 8-bit, 11.025 kHz mono sound for a button click. Always determine the minimum amount of quality acceptable for every instance of sound, but do yourself a favor: when capturing or altering sound, work at the maximum resolution and depth possible and then desample to lower rates on export. Robust original sound data has more latitude and fidelity and is therefore more tolerant to the ravages of editing and compression. However, as with digital imagery, it is never necessary to "scale-up" the data to a higher sampling or bit-depth - the file will be larger but not better, just laden with more of what you don't have





    Optimization techniques for sounds

    Sound is data intensive. The quality of the sound output and length of playback factor prominently into the amount of data required. Sounds with higher sample rates (22.5Khz and above) retain a greater degree of quality, but almost always require too much data to realistically stream sound to the Flash player on time over a 28.8Kbps modem. Flash utilizes compression to help reduce the size of the data - but even the maximum compression allowed in Flash may not be sufficient to deliver high quality audio over longer periods of time. Here are some tips to use sound more efficiently:

    Use the lowest bit-depth and sample rate acceptable to achieve the smallest data size.
    Sound quality deteriorates as the sample rate declines, so you may find lower sample rates yield more even playback but also poorer quality audio. Try to find a happy medium between quality and data size.

    Keep sounds short.
    Flash doesn't have the same type of compression capabilities as Shockwave streaming audio, so it is ill suited as a means to deliver longer audio programs. You may use smaller sounds looped to achieve longer audio playback because a smaller amount of sound data is downloaded once and used repeatedly.

    Watch the size report closely for clogging of data near keyframes.
    The Event synch option delivers the sound data all at once when needed for playback; Stream synch delivers the sound data over the specified series of frames. Watch the size report closely for clogging of data near keyframes and use the "preloading" techniques to trim down the amount of data needed per frame or per second.









    How audio works

    If you need to capture visual motion for reproduction, you take a lot of pictures with a movie camera and then play them back to see the motion. Sound is motion too, just like the ripples in the water. To capture sound for reproduction,you have to take a lot of little samplings of the motion and then drum them over a speaker to reproduce the sound. The number of samplings captured per second is called the sampling rate and is measured in hertz. These "sound bites" are like the frames of a movie. The sampling rate of pulses per second (Hz) is similar to a movie's frame rate of frames per second (FPS).

    Light moves fast — faster than sound. However, when you make a movie, you're not capturing light waves, you are capturing a sequence of static images. The light waves take care of themselves getting from the projector to the screen to our eyes. A process called persistence of vision helps the brain fill in the blanks between all those flickering frames.

    To reproduce sound, however, there is no such convenience. Recorded sound must duplicate the waves themselves, and sound waves can't be faked with a mere 24 samplings per second. Even a sampling rate of 5564 pulses per second is rather crude - kind of what you'd hear over a walkie-talkie. To get acceptable results for reproduction, like a good FM radio broadcast, 22050 pulses are produced every single second.




    More tips : http://www.gmf.as



  10. #10
    Member
    Join Date
    Jul 2000
    Location
    Brisvagas, Australia
    Posts
    64
    Yeah thanks for that GmF, alot of that I was taught at college but have forgoten... A good lesson in sound but it dosn't solve my problem of why my new smaller files won't import into flash...

  11. #11
    Senior Moderator ®
    FK´s Banning Machine ™
    GMF ™'s Avatar
    Join Date
    Feb 2000
    Location
    Oslo, Norway
    Posts
    5,697
    Then read this

    Sounds can use considerable amounts of disk space and RAM. MP3 sound data, however, is compressed and smaller than WAV or AIFF sound data. Generally, when using WAV or AIFF files, it's best to use 16-bit 22 kHz mono sounds (stereo uses twice as much data as mono), but Flash can import either 8- or 16-bit sounds at sample rates of 11 kHz, 22 kHz, or 44 kHz. Flash can convert sounds to lower sample rates on export.

    Save your files as 11 22 or 44. I always use 44 100 stereo , 16 bits wavs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center