Re: AudioConverterFillComplexBuffer for transcoding streamed audio [iMac OSX10.5.6]
Re: AudioConverterFillComplexBuffer for transcoding streamed audio [iMac OSX10.5.6]
- Subject: Re: AudioConverterFillComplexBuffer for transcoding streamed audio [iMac OSX10.5.6]
- From: Brian Willoughby <email@hidden>
- Date: Wed, 9 Jun 2010 16:38:17 -0700
On Jun 9, 2010, at 14:59, Abhinav Tyagi wrote:
1) I have noticed that the header is 4096 bytes if we use
AudioFileWritePackets. I remember the header for RIFF wave file is
only 44 bytes. Why is the header 4096 bytes.
RIFF/WAVE does not have a header. RIFF is a sequence of chunks which
can come in any order, and have varying sizes. The term 'header'
usually refers to a fixed length of data that always comes at the
beginning of a file, but since WAVE does not work this way, I avoid
using the term header. Logic Studio Pro, as one example, will
produce a perfectly valid WAVE that does not have a simple 44 byte
offset for the audio.
2) I am having transcoded audio slightly choppy:
My procedure for transcoding is based on taking a file from disk and
transcoding it to a wave file on disk. So I write about 32KB data to a
file and feed it to transcoder to give WAVE file. from this wave file,
i read the data and put it in memory buffe for transmitting to other
device.
Are you using the AudioFile code to read the WAVE? If not, then you
should.
However i noticed that the stream is continuous but the wave file has
lots of zeros in the beginning of the data portion. if i read whole
wave file data from 4096+ byte till end and buffer it, its horribly
choppy when played on device. In case if i omit the ZEROs from after
'data' tag till non zero samples occur, the audio seems to be fine
mostly however sometimes its slightly choppy. Also as the song is
played on the device, the wave buffered size reduces even though i am
writing data to buffer after transcoding.
This seems suspiciously like you have been using AudioConverter
incorrectly, and the stream was damaged before AudioFileWritePackets
stored the data on disk. You should find a way to confirm that
you're using AudioConverter correctly before getting too deep into
the WAVE format details.
Brian Willoughby
Sound Consulting
_______________________________________________
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