• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

While converting mp3 sound to wav data using WavWriter.as class

New Here ,
Nov 27, 2014 Nov 27, 2014

Copy link to clipboard

Copied

While converting mp3 sound to wav data using WavWriter.as class in an desktop AIR application, i have encountered these problems:-

a. Cannot copy the metadata from original file to the processed file. i.e id3 tags are not available in the processed file.

b. Song length is increased by few seconds, depends upon the original length of the file.

c. Cannot convert mp3 files where song length is greater than 20 mins. (Tested on PC with Win7, Intel i5, 4GB RAM, 500 GB HD)

Any suggestions how to solve these.

Thanks

TOPICS
Development

Views

458

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 29, 2014 Nov 29, 2014

Copy link to clipboard

Copied

In regards to not copying over the ID3 information, I did some research on wave audio file format and the format standard doesnt appear to support metadata information beyond sample rate, channels, and a few other bits of data. If you look at the source of the WavWriter.as class, it only handles writing the required information for a wave file. The info required when creating a wave file is, in this order, the compression type (PCM for example), number of channels, sample rate, byte rate, byte size of the audio portion of the wav file created, and bits per sample. Extra info can come after that before the actual audio data, but pretty much all audio programs only expect the values I listed above based on the wave file format.

Not sure what could be going on with the extra seconds being tacked on. Is it silence being added to the beginning or ended of the file or is it all music from beginning to end and is somehow longer in duration?

Lastly with the 20 minute limit, are you getting an error of any kind? Is there a WAV file being created that just has up to the 20 minute mark and it just doesnt include anything beyond that?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 30, 2014 Nov 30, 2014

Copy link to clipboard

Copied

Thanks for the response wadedwalker.

b.

c. We get the error

              Error: Error #1000: The system is out of memory.

                     at flash.utils::ByteArray/writeFloat()

Wav file is not created and stops the processing service.

This error depends upon the system memory. For 2GB RAM system it gives error for files larger than 12 mins and for 8GB   RAM system it gives error for files larger than 35 mins.

Any idea how can be overcome this. [Can the sound data object be created in bunch of byte-arrays and then to single byte-array to convert it to wav data]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 01, 2014 Dec 01, 2014

Copy link to clipboard

Copied

I think you would run into the same problem trying to use multiple ByteArray's since they still add up to the same amount of data. The multiple ByteArray's might work if you were splitting the source audio file into multiple WAV files to accommodate for the error.

Try changing the compressionCode variable value from "1" to "80" or "85" so it will use MPEG or MP3 compression instead of uncompressed PCM audio. It sounds like, pun not intended, the uncompressed PCM format is eating all your RAM trying to create the file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 02, 2014 Dec 02, 2014

Copy link to clipboard

Copied

LATEST

Thanks for your inputs

b.  The output wav file (PCM raw data) does not have any silence added in the conversion process.

c.  Yes, that I can change and see the results and can discuss with you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines