Re: Beep ( duration, frequency )

2015-09-24 Thread Maxthon Chan
If there is only a small selection of frequencies and durations your app need to play, you can pre-record them as audio files and play them back when required. If it’s something like an instrument or requires procedurally-generated audio, you may want to package the sound effect you want into a

Re: Beep ( duration, frequency )

2015-09-23 Thread Jens Alfke
> On Sep 23, 2015, at 9:05 PM, dangerwillrobinsondan...@gmail.com wrote: > > There is also AVAudioEngine added in Yosemite. > It's a higher level Objective-C API around Core Audio. > The docs still kind of don't tell you much and at times the API makes more > sense if you know a little about C

[ALERT:Possible Phishing] Re: Beep ( duration, frequency )

2015-09-23 Thread dangerwillrobinsondanger
There is also AVAudioEngine added in Yosemite. It's a higher level Objective-C API around Core Audio. The docs still kind of don't tell you much and at times the API makes more sense if you know a little about Core Audio but the friction is a lot less C level. The Amazing Audio Engine is a fa

Re: Beep ( duration, frequency )

2015-09-23 Thread Jens Alfke
> On Sep 23, 2015, at 8:11 PM, Raglan T. Tiger wrote: > > After I frustrated myself I realized your recommendation. Now I want to make > arbitrary sounds (am I a recording engineer to?) to use with +soundNAMED so > any suggestions while I Alphabet? For general sound recording or making synth

Re: Beep ( duration, frequency )

2015-09-23 Thread Raglan T. Tiger
-rags > On Sep 23, 2015, at 7:18 PM, k...@hh.iij4u.or.jp wrote: > > If you want to use different sounds for some alerts or notifications, you can > use sytem provided sounds, such as "Basso", "Frog", "Submarine", etc. > > NSSound *sound = [NSSound soundNamed:@"Submarine"]; > [sound play];

Re: Beep ( duration, frequency )

2015-09-23 Thread Charles Srstka
> On Sep 23, 2015, at 7:40 PM, Jens Alfke wrote: > >> On Sep 23, 2015, at 4:41 PM, Raglan T. Tiger > > wrote: >> >> I want code that is this simple on Windows: >> >> DWORD freq = 587; >> if(!something) freq = 659; >> if(another) freq = 523; >> Beep(freq, 150); >

Re: Beep ( duration, frequency )

2015-09-23 Thread kata
> Windows has a Beep function: > > BOOL WINAPI Beep( > _In_ DWORD dwFreq, > _In_ DWORD dwDuration > ); > > Is there anything this easy for OS X? If you want to use different sounds for some alerts or notifications, you can use sytem provided sounds, such as "Basso", "Frog", "Submarine", etc.

Re: Beep ( duration, frequency )

2015-09-23 Thread Quincey Morris
On Sep 23, 2015, at 17:40 , Jens Alfke wrote: > > No, there’s no simple API for this. There’s a simple way to play an arbitrary finite-length sound (AVAudioPlayer). All you need is a sound file (or a couple of sound files) that can easily be created in an audio editor. It’s only 2 lines to pla

Re: Beep ( duration, frequency )

2015-09-23 Thread Jens Alfke
> On Sep 23, 2015, at 4:41 PM, Raglan T. Tiger wrote: > > I want code that is this simple on Windows: > > DWORD freq = 587; > if(!something) freq = 659; > if(another) freq = 523; > Beep(freq, 150); No, there’s no simple API for this. This API in Windows is a relic of the early PC days when ge

Re: Beep ( duration, frequency )

2015-09-23 Thread Raglan T. Tiger
-rags > On Sep 23, 2015, at 5:49 PM, Ed Wynne wrote: > > That said, synthesizing beep-like-waveforms isn’t very hard. You should ask > google, or stack overflow. Well I have googled and see many more lines of code that the simple windows Beep ... PIA -rags ___

Re: Beep ( duration, frequency )

2015-09-23 Thread Ed Wynne
On Sep 23, 2015, at 7:41 PM, Raglan T. Tiger wrote: > > >> On Sep 23, 2015, at 5:30 PM, Jens Alfke wrote: >> >> What is it you’re trying to do? > > I want code that is this simple on Windows: > > DWORD freq = 587; > if(!something) freq = 659; > if(another) freq = 523; > Beep(freq, 150); O

Re: Beep ( duration, frequency )

2015-09-23 Thread Kaydell Leavitt
> On Sep 23, 2015, at 5:31 PM, Richard Charles wrote: > > >> On Sep 23, 2015, at 5:13 PM, Raglan T. Tiger wrote: >> >> Windows has a Beep function: >> >> BOOL WINAPI Beep( >> _In_ DWORD dwFreq, >> _In_ DWORD dwDuration >> ); >> >> Is there anything this easy for OS X? > > void NSBeep (void

Re: Beep ( duration, frequency )

2015-09-23 Thread Raglan T. Tiger
> On Sep 23, 2015, at 5:30 PM, Jens Alfke wrote: > > What is it you’re trying to do? I want code that is this simple on Windows: DWORD freq = 587; if(!something) freq = 659; if(another) freq = 523; Beep(freq, 150); ___ Cocoa-dev mailing list (Coco

Re: Beep ( duration, frequency )

2015-09-23 Thread Richard Charles
> On Sep 23, 2015, at 5:13 PM, Raglan T. Tiger wrote: > > Windows has a Beep function: > > BOOL WINAPI Beep( > _In_ DWORD dwFreq, > _In_ DWORD dwDuration > ); > > Is there anything this easy for OS X? void NSBeep (void); This is a standard system alert. The term “beep” implies an alert, me

Re: Beep ( duration, frequency )

2015-09-23 Thread Jens Alfke
> On Sep 23, 2015, at 4:13 PM, Raglan T. Tiger wrote: > > Is there anything this easy for OS X? Well, NSBeep() is pretty easy if you just want to play a sound to alert the user. There’s no simple way to play ugly-sounding poorly-timed square waves, like the Windows Beep function. You’d need

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 ot

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 http://www.warplife.com/

Re: Beep ( frequency, duration)

2014-12-30 Thread Jens Alfke
> On Dec 29, 2014, at 2:12 PM, Michael Crawford 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 is fine. But for

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 m

Re: Beep ( frequency, duration)

2014-12-29 Thread Wim Lewis
On Dec 29, 2014, at 2:12 AM, Michael Crawford 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 comput

Re: Beep ( frequency, duration)

2014-12-29 Thread Paul Scott
> On Dec 29, 2014, at 2:12 AM, Michael Crawford 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) AudioComponentInsta

Re: Beep ( frequency, duration)

2014-12-29 Thread Jens Alfke
> On Dec 29, 2014, at 2:12 AM, Michael Crawford 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 super-high-priority (real-time

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 hardw

Re: Beep ( frequency, duration)

2014-12-28 Thread Paul Scott
On Dec 28, 2014, at 12:05 PM, Raglan T. Tiger 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 example, a sine wav

Re: Beep ( frequency, duration)

2014-12-28 Thread Jens Alfke
> On Dec 28, 2014, at 12:05 PM, Raglan T. Tiger 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. I don't think there

Re: Beep

2009-08-26 Thread Randall Meadows
On Aug 26, 2009, at 10:47 AM, Sumanth Peddamatham wrote: NSBeep(). I've been searching though the iPhone audio API ^^ Impedance mismatch. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: Beep

2009-08-26 Thread I. Savant
On Aug 26, 2009, at 12:47 PM, Sumanth Peddamatham wrote: NSBeep(). http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Miscellaneous/AppKit_Functions/Reference/reference.html#//apple_ref/c/func/NSBeep That doesn't let you control frequency or duration. It merely trigge

Re: Beep

2009-08-26 Thread Kyle Sluder
On Wed, Aug 26, 2009 at 9:47 AM, DKJ wrote: > Have I missed something simple? If so, please point me to the right place in > the docs. No you haven't missed anything. You're going to need to generate and feed PCM samples to the audio hardware. You'll want to ask the coreaudio-api list for more i

Re: Beep

2009-08-26 Thread Sumanth Peddamatham
NSBeep(). http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Miscellaneous/AppKit_Functions/Reference/reference.html#/ /apple_ref/c/func/NSBeep Best, Sumanth P. On Aug 26, 2009, at 12:47 PM, DKJ wrote: Once upon a time, there was a computer language called BASIC. It w