http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sound - Adlib/SB/PC Speaker



Hi,

Yes, I was aware of that, however, what should I do if I want to make a
quick sound, like for a game? Instead of playing a whole sound file? I
know most modern games use sound files to store their sounds anyway, but
what is the simplest form of a sound in Linux? (Or is this it?)

Thanks for that info! I'll definitely check it out!

Sure, no problem, I've done it under Dos, just a little practise on driver
programming, and I'll have it running under Linux, thanks for the idea!
:-) But would this just be simply turning the speaker on and off rapidly,
or would I use the PIT chip or something?

No sorry, I was a little confused there, I just meant to play sound
directly from the program instead of from an audio file, but now that I
think of it, wouldn't it be possible (it seems anyway) to have a piece of
audio code in your program, and then send it to /dev/audio? But my main
concern is: What would the format of this be? I mean, what do I send to
make a sound? A simple example would be appreciated!

Ciao,

Lionel

On Thu, 12 Oct 2000, Ben Kohlen wrote:

> Writing an audio file to /dev/dsp || /dev/audio is the professional way to 
> do it under linux.  Device files is how you access drivers->hardware on any 
> UNIX.
> 
> If you want to see how a soundblaster driver works, look in the linux source 
> under linux/drivers/sound/sb_*.c (particularly sb_audio.c).
> 
> Look at audio.c to see the implementation of the /dev/audio character 
> device.
> 
> As far as the PC-speaker goes, i've never thought about it, and I am not 
> aware of a /dev/ device associated with it, although i am sure there is one. 
> You always seemed like a guy that didn't mind bare-metal programming, so if 
> you are interested, find the IO range of the hardware and write your own 
> character device for it. (you know how to use inp()/outp() right?) In fact, 
> if anyone wanted a good introduction to writing device drivers under linux, 
> that would be an almost ideal project, as the hardware isn't too complicated 
> and you could mostly focus on learning how linux drivers work. Just get 
> yourself a copy of "Linux Device Drivers" from O'Reilly first, as it is the 
> new definitive guide.
> 
> Real-time sound? no, in fact, i don't think i follow... explain?
> 
> >From: Lionel Pinkhard <lionelp@worldonline.co.za>
> >Reply-To: gameprogrammer@gameprogrammer.com
> >To: gameprogrammer@gameprogrammer.com
> >Subject: Sound - Adlib/SB/PC Speaker
> >Date: Thu, 03 Jan 1980 02:25:47 +0000 (UTC)
> >
> >Hey guys,
> >
> >Can somebody tell me how does Linux sound work? I'm especially interrested
> >in the PC Speaker, since that's what I know the LEAST about, I know that
> >with the other two, it's possible to write a sound file to /dev/audio, or
> >/dev/dsp, but is there a more 'professional' way of doing this? Actually,
> >I'm talking about real-time sound, and not sound from a file, you guys
> >know what I mean?
> >
> >Well, hope somebody can help!!!
> >
> >Lionel
> >
> >=================================================================
> >The GameProgrammer.Com mailing list is for the open discussion
> >of any topic related to the art, science, and business of
> >programming games. This list is especially tolerant of beginners.
> >We were all beginners once
> >
> >To SUBSCRIBE or UNSUBSCRIBE please visit:
> >http://gameprogrammer.com/mailinglist.html
> >
> 
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> Share information about yourself, create your own public profile at 
> http://profiles.msn.com.
> 
> =================================================================
> The GameProgrammer.Com mailing list is for the open discussion
> of any topic related to the art, science, and business of
> programming games. This list is especially tolerant of beginners.
> We were all beginners once
> 
> To SUBSCRIBE or UNSUBSCRIBE please visit:
> http://gameprogrammer.com/mailinglist.html
> 

=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html