Re: [Osalp-dev] Saving files...
Status: Abandoned
Brought to you by:
daservis
From: Hugh M. <hu...@mo...> - 2004-11-04 11:37:46
|
I think I've found part of the problem.... Again, maybe I'm doing something wrong, or maybe it's a dodgy file writer... But when I look at a dump of my created file, the 'length' field (bytes 4-7) is set to 0. Am I missing a function to write this later, or is the code at fault? I know this is a pretty quiet list, but I'd love any info I can get on this... Cheers Hugh Macdonald (at a slightly different e-mail address) On Thu, 4 Nov 2004 09:08:32 +0000 Hugh Macdonald <hug...@gm...> wrote: > I've been using osalp for a short while now for opening files (which I > then store in a custom format before passing to libquicktime), but I'm > now trying to go the other way, and am having slight problems.... > > Here's a chunk of my code: > (audioData is a 2D array of size audioChans*audioSamples) > > aflibConfig sInfo; > aflibStatus sStatus; > > sInfo.setChannels(audioChans); > sInfo.setSampleSize(AFLIB_DATA_16S); > sInfo.setSamplesPerSecond(audioSampleRate); > sInfo.setTotalSamples(audioSamples); > > aflibFile *sFile = aflibFile::create("AIFF", audioFile, sInfo, &sStatus); > if(sStatus != AFLIB_SUCCESS) > { > // Check what the error is, print error message and return > } > aflibData audData(sInfo, audioSamples); > for(chan = 0; chan < audioChans; chan++) > { > for(sample = 0; sample < audioSamples; sample++) > { > audData.setSample(audioData[chan][sample], sample, chan); > } > } > sFile->afwrite(audData); > > > At the end of this, I have my file, but the header information seems > to be corrupt... I've got a tool for printing out the header > information of a .aif file - it uses libsndfile (this was what I used > before I discovered osalp) - this gives correct header information > except the number of frames (samples) which it reports as 0. > > The other thing that's bugging me (which I suspect I can't do anything > about) is that I don't seem to be able to set the format as "AUTO" > when creating a file - If I do, I get > AFLIB_ERROR_INITIALIZATION_FAILURE - it's not going to be too hard for > me to write code that checks the needed extension and gives the right > format, but I was surprised that this wasn't what "AUTO" did.... > > anyway, cheers for any help... > > -- > Hugh Macdonald > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > Osalp-dev mailing list > Osa...@li... > https://lists.sourceforge.net/lists/listinfo/osalp-dev -- Hugh Macdonald The Moving Picture Company |