--- YOGIRS wrote:
>  how does audio  player in linux works?

There's a lot of open source players, so you can see their code
yourself. Take something simple like aplay or mpg123 for examination.

>  Is it they open the ports and write or
>  do they have any special files.

There are various ways. You can write raw audio directly to /dev/dsp.
It requires exclusive access, but there are wrappers for each sound
system (ARTS, eSound, etc.) that give virtual dsp device to your
program. But, I wouldn't really recommend that. 

Then, there's OSS and ALSA, I'd recommend the latter as OSS is soon
going to be obsolete on all distros. There are also special libraries
that give you ability to play various formats out-of-the-box. Take
SDL_sound as a good example, here's a list of supported formats:

http://icculus.org/SDL_sound/

As you can see, SDL_sound wraps various other libs, but if you only
need (for example) MP3 playback, then using SMPEG library alone should
be enough.

There's also GStreamer library in case you want to play both audio and
video files (like WinAmp 5). It also supports streaming audio/video,
which may be interesting if your player will allow listening to
Internet radio stations and stuff like that.

-- 

Milan Babuskov
http://www.guacosoft.com


Reply via email to