Re: Beep ( frequency, duration)

2014-12-30 Thread Jens Alfke
On Dec 29, 2014, at 2:12 PM, Michael Crawford mdcrawf...@gmail.com wrote: My input does come from another thread, reading ogg vorbis, flac, wave or mp3 files that write into a circular buffer. If you're doing this for your own entertainment or education, going the low-level route like this

Re: Beep ( frequency, duration)

2014-12-30 Thread Michael Crawford
If you're doing this for your own entertainment or education I would tell you why I'm doing this, but to do so would just lead to Chris Hanson bringing down the banhammer on me again. ;-D Mike Michael David Crawford, Consulting Software Engineer mdcrawf...@gmail.com

Re: Beep ( frequency, duration)

2014-12-30 Thread Michael Crawford
I will mention that I stopped working on Ogg Frog because there was an architectural problem I could not solve. I may have the solution at hand now but it's going to be a while before I actually try it. The input codecs weren't the problem, I was using Xiph's code for Ogg Vorbis and FLAC, some

Re: Beep ( frequency, duration)

2014-12-29 Thread Michael Crawford
The following plays a 441 Hz tone directly into the audio driver. If you alter this code, it is important not to block requests from the audio driver for more samples. While this source runs in userspace, and it supplies data from userspace, the requests for samples seem to be coming from a

Re: Beep ( frequency, duration)

2014-12-29 Thread Jens Alfke
On Dec 29, 2014, at 2:12 AM, Michael Crawford mdcrawf...@gmail.com wrote: While this source runs in userspace, and it supplies data from userspace, the requests for samples seem to be coming from a hardware interrupt task. It's not quite that low-level! It's a thread, but a

Re: Beep ( frequency, duration)

2014-12-29 Thread Paul Scott
On Dec 29, 2014, at 2:12 AM, Michael Crawford mdcrawf...@gmail.com wrote: OpenAComponent( comp, output ) CloseComponent( output ) These are deprecated since — I believe — OS X 10.8. You should probably use the iOS compatible functions: AudioComponentInstanceNew(comp, output)

Re: Beep ( frequency, duration)

2014-12-29 Thread Wim Lewis
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

Re: Beep ( frequency, duration)

2014-12-29 Thread Michael Crawford
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

Beep ( frequency, duration)

2014-12-28 Thread Raglan T. Tiger
Is it possible with Cocoa to generate a tone of a specified frequency and duration to play synchronously? -rags ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: Beep ( frequency, duration)

2014-12-28 Thread Jens Alfke
On Dec 28, 2014, at 12:05 PM, Raglan T. Tiger r...@crusaderrabbit.net wrote: Is it possible with Cocoa to generate a tone of a specified frequency and duration to play synchronously? You might be able to do this with AVFoundation, or you may need to descend to the C-based CoreAudio APIs.

Re: Beep ( frequency, duration)

2014-12-28 Thread Paul Scott
On Dec 28, 2014, at 12:05 PM, Raglan T. Tiger r...@crusaderrabbit.net wrote: Is it possible with Cocoa to generate a tone of a specified frequency and duration to play synchronously? -rags You can use Audio Unit Framework from Objective-C or Swift to generate sound on the fly. For