Ringing the bell |
Ringing the bell |
Donny Viszneki
Guest
|
If it isn't going to use the SDL audio subsystem, what would be the
advantage of making it part of 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. On Mon, Aug 17, 2009 at 6:08 PM, Brian Raiter<breadbox at muppetlabs.com> wrote:
-- http://codebad.com/ |
|||||||||||||
|
Ringing the bell |
Brian Raiter
Guest
|
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. 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.
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. 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. b |
|||||||||||||||
|
Ringing the bell |
Donny Viszneki
Guest
|
On Mon, Aug 17, 2009 at 7:17 PM, Brian Raiter<breadbox at muppetlabs.com> wrote:
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 C-preprocessor. 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 compiler.
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.
Ok, here is what I know: http://linux.die.net/man/3/xkbbell
Eh, simpler libraries exist. -- http://codebad.com/ |
|||||||||||||||||||||||
|
Ringing the bell |
Alex Barry
Guest
|
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... -Alex On 8/17/09, Donny Viszneki <donny.viszneki at gmail.com> wrote:
|
|||||||||||||||||||||||||
|
Ringing the bell |
Jonathan Dearborn
Guest
|
Ah, Alex beat me to it... I think the common way is printf("\a")?
Jonny D On Tue, Aug 18, 2009 at 7:18 AM, Alex Barry<alex.barry at gmail.com> wrote:
|
|||||||||||||||||||||||||||
|
Ringing the bell |
Jonathan Dearborn
Guest
|
I think there are ways to control the beep's frequency and duration
(in my experience, producing ear-splitting "music"). These are probably system-dependent and could use a cross-platform wrapper. Jonny D On Tue, Aug 18, 2009 at 9:32 AM, Jonathan Dearborn<grimfang4 at gmail.com> wrote:
|
|||||||||||||||||||||||||||||
|
Ringing the bell |
Bill Kendrick
Guest
|
On Tue, Aug 18, 2009 at 09:38:52AM -0400, Jonathan Dearborn wrote:
This was with straight X Window API (Xlib), but I made a few games on the Agenda VR3 (the first commerically-available Linux-based PDA) and used the X bell to play sound effects. :) (The system had a headphone jack for playing real sound, but the system was a bit underpowered, and most people play games on PDAs w/o plugging in headphones. The Zaurus was similar... it could beep and click using a built-in speaker, but for 'real' sound you needed headphones or an set of external speakers.) -bill! |
|||||||||||||
|
Ringing the bell |
James Haley
Guest
|
The Chocolate Doom project (www.chocolate-doom.org) has a PC speaker
emulation library which can attach to the SDL audio core or to SDL_mixer and provides a fully functional square wave generator. Chocolate DOOM and my own port, Eternity, use this code to support the PC speaker format sound effects that were used in DOOM, but with a little extra work it could be made to play arbitrary sounds. The best thing about it is that it's portable; no conditionals are needed. The worst thing about it is that it has no filtering, and that I believe listening to it for an extended period of time can cause damage to your hearing. I certainly know it made my ears hurt for several hours... ----------------------------------------
_________________________________________________________________ Windows Live: Keep your friends up to date with what you do online. http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_online:082009 |
|||||||||||||
|