• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
File format conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

File format conversion


  • Subject: File format conversion
  • From: Fredrik <email@hidden>
  • Date: Wed, 4 Feb 2009 00:29:20 +0100

Hi,

I´m trying to make a format converter that converts from two uncompressed formats, in this case wav to aif.
I have managed to create the new file (aif) with the correct header but some of the fields in the header doesn´t reflect
the actual size of the data but only an empty header. So in this case the FORM chunk size is 4088 bytes, number of sample frames is 0 and the SSND chunk size is 8.


I don´t get where the problem could be, I have looked over the AudioStreamBascDescription struct that I have filled in like this:


AudioStreamBasicDescription OutFormat; OutFormat.mSampleRate = 44100; OutFormat.mFormatID = kAudioFormatLinearPCM; OutFormat.mFormatFlags = kAudioFormatFlagIsBigEndian; OutFormat.mBytesPerPacket = 2; OutFormat.mFramesPerPacket = 1; OutFormat.mBytesPerFrame = 2; OutFormat.mChannelsPerFrame = 1; OutFormat.mBitsPerChannel = 16;

The file is mono, 16 bit 44.1


I then write the file like this, I have checked the size of propertyData and it´s correct.


	AudioFileWriteBytes(convertedFile,
			    false,
			    0,
			    &propertyData,
			    &buf.mData);

I guess that I also need a AudioConverter to perform endian conversion on the data but is that the reason that the size
fields of the header is missed?



_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: File format conversion
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: audio queue play from memory source
  • Next by Date: Re: File format conversion
  • Previous by thread: Re: MP3 and AAC licenses for iPhone
  • Next by thread: Re: File format conversion
  • Index(es):
    • Date
    • Thread