Re: No Alert, Discard Change, & Beep

2016-04-20 Thread dangerwillrobinsondanger
> On Apr 20, 2016, at 3:40 PM, Richard Charles wrote: > > The engineers at Apple that invented and implemented this stuff must have > been amazing. And at NeXT before that. The folks who work and have worked on Cocoa have always included people with broad minds, deep talent and x-ray visio

Re: No Alert, Discard Change, & Beep

2016-04-19 Thread Richard Charles
d field back to. I mention > this because beeping is only a marginally less crappy UI than the one you’re > trying to avoid. Actually a beep is not all that bad. But then again it depends on how often your computer is beeping. I worked at a place once where there was a room full of engin

Re: No Alert, Discard Change, & Beep

2016-04-19 Thread Quincey Morris
On Apr 19, 2016, at 22:25 , Richard Charles wrote: > > I am not sure where the alert sheet comes from but … I just looked this up here: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/MessageFlow.html

Re: No Alert, Discard Change, & Beep

2016-04-19 Thread Richard Charles
as a document-modal sheet attached to the document window. Instead we simply beep, abort editing, and reset the text field for editing again. The documentation cautions against overriding this method but I could not find anything else that worked. --Richard Charles ___

Re: No Alert, Discard Change, & Beep

2016-04-19 Thread Quincey Morris
On Apr 19, 2016, at 16:11 , Richard Charles wrote: > > I have a NSTextField with a NSFormatter. When the user enters an incorrect > value an alert sheet drops down from the document window stating “Please > provide a valid value.”. Is the text field bound to a NSObjectController, or how does i

No Alert, Discard Change, & Beep

2016-04-19 Thread Richard Charles
the change and beep. You can see this behavior in some inspector text fields of Apple Productivity Apps (Numbers, Pages, etc). A NSTextFieldDelegate method has been implemented like so. - (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSStri

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

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

2015-09-23 Thread Raglan T. Tiger
I found that Glass, Ping and Pop are real close to the Windows frequencies used. Mark it implemented. -rags ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the mo

[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 > <mailto:r...@crusaderrabbit.net>> wrote: >> >> I want code that is this simple on Windows: >> >> DWORD freq = 587; >> if(!something) fr

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 "Bas

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

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 ..

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; >

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 >> ); >

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 mai

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. Th

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. Y

Beep ( duration, frequency )

2015-09-23 Thread Raglan T. Tiger
Windows has a Beep function: BOOL WINAPI Beep( _In_ DWORD dwFreq, _In_ DWORD dwDuration ); Is there anything this easy for OS X? -rags ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

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

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 th

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
erely triggers the user's chosen default sound. Further, the link you provided is for ApplicationKit, which isn't part of the iPhone API. In short, I don't think this addresses the OP's question. http://developer.apple.com/iphone/search/search.php?Search=beep ... turns up n

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
was installed in just about every computer; usually with a soldering iron. And a favourite beginner programmer project was getting the computer to emit sounds when keys were pressed. As I recall, there was something like a "BEEP" command that let you do this quite easily, and al

Beep

2009-08-26 Thread DKJ
"BEEP" command that let you do this quite easily, and also let you set parameters like duration and frequency. I've been searching though the iPhone audio API looking for something similar: i.e. a method that will let me generate a sound ex nihilo, with a given duration and fr

NSComboBox beep

2008-11-19 Thread James Walker
If I use the Return key to select an item from the list of a non-editable combo box, there is a beep and the action message is not sent. This does not happen if the mouse is used to select an item. Is this a bug, or am I missing something? The reason I want to use an uneditable NSComboBox