• 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
Re: Disappearing static pops
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disappearing static pops


  • Subject: Re: Disappearing static pops
  • From: Todd Heberlein <email@hidden>
  • Date: Tue, 02 Apr 2002 18:42:11 -0800

On 4/2/02 6:21 PM, "Todd Heberlein" <email@hidden> wrote:

> o my application -> static pops
> o Sound Studio AND my application -> no static pops
> o quit Sound Studio, and the static pop noise comes back when recording

OK, bad form to reply to your own post, but I think I have found a solution,
but I still do not know *why* this works. Below is the a brief model of the
code that pops and the code that produces clean recordings.

The primary difference is that when I start my program I immediately start
the callback thread with AudioDeviceStart() so the callback is being called
continuously, and now I just use a static BOOL to indicate whether the data
passed to the callback should be recorded or not.

Should we *not* be using AudioDeviceStart() and AudioDeviceStop() to begin
and end recording?

Happy that it works, but confused as to why,

Todd


-------------------------------------------------

Original code model (that produces static pops)

Callback()
{
record all data into a buffer;
}

-init()
{
find default audio;
register callback with AudioDeviceAddIOProc();
}

- pressRecord()
{
if turning on recording, start callback with AudioDeviceStart();
else, stop callback with AudioDeviceStop();
}


-------------------------------------------------
New Code model (that doesn't produce static pops)

Static BOOL Record_the_data = NO;


Callback()
{
if (Record_the_data == NO) return from callback;
else record all the data;
}

- init()
{
find default audio;
register callback with AudioDeviceAddIOProc();
start callback with AudioDeviceStart();
}

- pressRecord()
{
if turning on recording, Record_the_data = YES;
else Record_the_data = NO;
}
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

References: 
 >Disappearing static pops (From: Todd Heberlein <email@hidden>)

  • Prev by Date: Disappearing static pops
  • Next by Date: Re: MIDIReadProc and reentrancy
  • Previous by thread: Disappearing static pops
  • Next by thread: Re: MIDIReadProc and reentrancy
  • Index(es):
    • Date
    • Thread