How to play sound?

Posted by: kim

How to play sound? - 27/02/2000 05:02

Now that we have a code snippet for setting pixels to screen, know how to interpret the front panel buttons & remote - we have no information on how to put raw sound data to soundcard and play it.

Is there any chance of revealing the mystery of empeg's sound card functionality? Just a small low-level example would be enough, just to see where the sound card buffers are and how to play them.

I see that it's not as straight forward as setting pixels to screen as it probably needs an own interrupt/process for taking care that playing buffers always has enough data, and so on. But anyway it would be nice to get some sound out of empeg in own programs (besides the DSP beeps ;).

Kim

Posted by: altman

Re: How to play sound? - 27/02/2000 13:07

Errr, there is info: you open /dev/audio and write data to it. There are lots of ioctls (eg to unmute the output - I think these are covered on the developer site) but basically you just write data to it in 4608 byte chunks and it deals with the rest.

Hugo


Posted by: Verement

Re: How to play sound? - 27/02/2000 13:40

I just added some sample code to the developer site that may be illuminating.

There is also a lot of good information about the Open Sound System available online for the general API.

-v

Posted by: kim

Re: How to play sound? - 28/02/2000 04:34

Well - you guys see that I'm more a Win32 developer than a Linux. I've used to write hundreds of lines of code to get a beep out of a soundcard ;)

And thanks for the sample code - I'll be looking for my empeg to say something nice when I turn it on :)

By the way, as the developer site already contains sample code, it might be a good idea to put a place where people could send their own empeg programs as binaries as well. For people who don't want to compile the programs and for people who don't want to distribute their sources.

It wouldn't have to be that far away even a 3rd party to develop horizontal tetris or whatever nice things - I already have a neat boot loader ;)

Kim