Re: [Resend]. ExtAudioFileAsync problem...
Re: [Resend]. ExtAudioFileAsync problem...
- Subject: Re: [Resend]. ExtAudioFileAsync problem...
- From: "tahome izwah" <email@hidden>
- Date: Sat, 29 Jul 2006 18:14:36 +0200
Lionel,
thanks for the note. I would expect the queue to grow as I add data,
and there is no reason why it should overflow (if this isn't a design
flaw and its size is fixed).
Instead, I would expect the ExtAudioFileWriteAsync to return an error
if an overflow occurs, but nothing, nada happens!
This is all very confusing I think...
--th
2006/7/29, Lionel <email@hidden>:
Hi,
When you call ExtAudioFileWriteAsync, your request is queued(since it
must be asynchronous). When the queue is too long, some requests may
be dropped ... If i were you, i would wait for the asynchronous call
to be finished(you are supposed to give a function to be called when
it is finished) before another call to ExtAudioFileWriteAsync(that 's
what i do with asynchronous calls). And this problem does not exist
(of course) with synchronous calls because the requests are made
immediately, before you can make another one.
Lionel
Le 29 juil. 06 à 11:14, tahome izwah a écrit :
> Hi all,
>
> since I've not had a response to my question/bug report, here I am
> sending it again. If anyone could shed some light on this or point me
> to a more appropriate contact/forum it would help me tremendously
> because I am stuck here!
>
> Thanks,
> --th
>
> ----------------------------------------------------------------------
> -----------------------------
>
> Hi all,
>
> I am currently debugging an application of mine based on the latest
> RecordAudioToFile code example. Instead of reading from the default
> Audio Unit to record from the audio-in I am creating the data myself
> in a short loop like this:
>
> long x = 0.;
> for (long i = 0; i < 25; i++)
> {
> for (long c = 0; c < framesPerWrite; c++)
> data[0][c]=data[1][c]=sin(1000.*2.*M_PI*x++/44100.);
>
> err = audioFileWriter->Write(data, framesPerWrite);
> if(err != noErr) break;
>
> printf("writing %d\n", i);
> }
>
> The two-dimensional data[][] array gets converted to an
> AudioBufferList in my call to Write() and then ExtAudioFileWriteAsync
> is called to do the actual write to disk, but strange things are
> happening. Sometimes the resulting file is 1.2 MB in size (which is
> the size it should be), sometimes it's only 180k and sometimes it is
> an empty file of 4k. Note that this is the size after
> ExtAudioFileDispose so I do not believe it to be a cache problem.
>
> I was able to verify that the problem does not occur when I perform
> synchronous writes through ExtAudioFileWrite so I guess it might be a
> timing thing... is it possible that successive calls to
> ExtAudioFileWriteAsync can cause it to miss data? I am using the same
> allocated AudioBufferList for each call and just fill it with new
> data...
>
> I am not getting an error from ExtAudioFileWriteAsync either,
> everything is running smoothly except that no/not enough data are
> being written to the file.
>
> Am I missing something or is this a bug in ExtAudioFileWriteAsync
> causing it to return prematurely, ie. before the data are copied to
> the internal ring buffer?
>
> Thanks,
> Tahome
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> 40wanadoo.fr
>
> This email sent to email@hidden
>
_______________________________________________
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