I wrote BirthCry.cpp when I was just getting started on Ogg Frog. It's still not released but one of my beta testers released it for me at Github after I specifically asked him not to.
Next time I'll request an NDA. This sends 441 kHz PCM directly to the audio card. It doesn't use QuickTime in any way. You don't want to block on a mutex when you do that and run out of samples; send it silence instead. I did it that way at first but it scared both my dogs and very nearly set my MacBook Pro on fire! https://github.com/rushgorden/oggfrog/blob/master/Source/OggFrog_10-Dec-2006/oggfrog/BirthCry.cpp Michael David Crawford, Baritone [email protected] One Must Not Trifle With Wizards For It Makes Us Soggy And Hard To Light. On Sun, May 29, 2016 at 10:10 AM, Jens Alfke <[email protected]> wrote: > >> On May 28, 2016, at 8:24 PM, Graham Cox <[email protected]> wrote: >> >> I’m looking for general pointers to the simplest/quickest way to generate an >> audio tone (sine wave) of a given frequency and duration. Most of the audio >> APIs seem concerned with playing samples rather than generating tones, so >> it’s not immediately obvious where to look. > > It’s easy to generate a sample buffer of a sine wave. Allocate an array of > uint16_t, and fill in each sample by scaling such that -1 ⟶ 0 and 1 ⟶ 255. > Then tell whatever API you’re using that it’s a 1-channel 16-bit PCM buffer. > Choose whatever sample rate you want to make it come out the right frequency; > it’ll do the interpolation for you. > > —Jens > _______________________________________________ > > Cocoa-dev mailing list ([email protected]) > > 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 [email protected] _______________________________________________ Cocoa-dev mailing list ([email protected]) 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 [email protected]
