[SDL] Ringing the bell
alex.barry at gmail.com
Tue Aug 18 04:18:25 PDT 2009
If you wanted to do things easy, isn't ascii #7 the bell character?
printf( "\7" );
This should produce a small beep noise, although you will need a
console to output it on...
On 8/17/09, Donny Viszneki <donny.viszneki at gmail.com> wrote:
> On Mon, Aug 17, 2009 at 7:17 PM, Brian Raiter<breadbox at muppetlabs.com>
>>> If it isn't going to use the SDL audio subsystem, what would be the
>>> advantage of making it part of SDL?
>> The advantage is that I wouldn't have to have a bunch of
>> platform-dependent #ifdefs in my code (and possibly my Makefile). In
>> other words, pretty much the same reason for using any other feature
>> of SDL. Consider the fact that most every major platform has a
>> documented way to sound a simple alert. It's such a basic feature that
>> it's embedded in the ASCII charset. Ringing the alert bell is
>> traditionally considered a feature of the terminal, not the soundcard.
> You misunderstand.
> No matter where the portable beep code lives, it's going to require
> conditional compilation, and it will probably be provided by the
> Don't put that in your application code.
> Separate it out into a separate package, and maintain it separately.
> Design a portable API that you think suits the features you want to
> expose to the API consumer, and that will work with the implementation
> details specific to each platform. This is where your #ifdefs and such
> will live. Putting it in SDL does not erase the challenge of having
> "platform dependent #ifdefs" conditionally expose code to the
>> Obviously, it's not something that most games need, but for plenty of
>> other apps, it would certainly be useful. Clearly you don't agree.
> Nothing clear about that. I do agree. I just don't think you'll find a
> lot of momentum here. The *best* way to get the SDL community and
> maintainers motivated to add beep support, IMHO, is to write the code
> yourself, and ask if SDL could include it. Usually, this would mean I
> would suggest writing a patch for SDL, but since you don't want to use
> SDL's audio subsystem, you're asking for a completely orthogonal
> feature set. You *could* still write it as an SDL patch, but then if
> the community doesn't dig your code, you'd be stuck with a patched SDL
> that nobody else had, and your programs would be using SDL APIs that
> no one else had, either. If you just write your own library, it might
> get incorporated into SDL some day, and in the meantime you'll have
> created a library that I'm sure plenty of projects can use, regardless
> of whether or not they use SDL.
>>> I'd say a BIG step closer to what you want in life would be to write
>>> a library for making a beep noise yourself.
>> Well, that's what I'm trying to do. Did you even notice the code I
>> posted? But of course I don't know much about platforms that I don't
>> have easy access to, so I'm asking for assistance.
> Ok, here is what I know:
>> In any case, I don't think such a tiny function merits an entire
>> library. I mean, so far it's what? ten lines long.
> Eh, simpler libraries exist.
> SDL mailing list
> SDL at lists.libsdl.org
More information about the SDL