> Depending on what your overall goal is In this particular case, all I wanted was to learn how to spit audio samples directly into the sound driver.
My input does come from another thread, reading ogg vorbis, flac, wave or mp3 files that write into a circular buffer. When the buffer is full a mutex blocks the input thread; when the buffer is empty it feeds silence - zeros - into the sound driver. Michael David Crawford, Consulting Software Engineer mdcrawf...@gmail.com http://www.warplife.com/mdc/ Available for Software Development in the Portland, Oregon Metropolitan Area. On Mon, Dec 29, 2014 at 1:14 PM, Wim Lewis <w...@omnigroup.com> wrote: > > On Dec 29, 2014, at 2:12 AM, Michael Crawford <mdcrawf...@gmail.com> wrote: >> for ( int i = 0; i < inNumberFrames; ++i ){ >> *sample++ = sin( twoPi * ( now / 100.0 ) ); >> now += 1.0; >> } > > > Depending on what your overall goal is, it might be easier to use the > software MIDI synthesizer instead of computing the samples yourself-- if you > want a bandlimited start and end, or even a music-like attack/decay/release > envelope or a spectrum more complicated than a pure sine wave, using > something like the AVMIDIPlayer class might free you from a bunch of realtime > requirements and bookkeeping. > > (On the other hand, I've never tried using it, so I don't know if its simple > API hides a well of frustration.) > > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/mdcrawford%40gmail.com > > This email sent to mdcrawf...@gmail.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com