[Klug-general] Linux Sound Programming

Peter Childs peterachilds at gmail.com
Wed Mar 17 09:43:59 UTC 2010


On 17 March 2010 09:28, James Morris <james at jwm-art.net> wrote:
> On Wed, March 17, 2010 07:23, Peter Childs wrote:
>> On 17 March 2010 06:17, Thomas Edward Groves <teg451013 at freeuk.com> wrote:
>>> I know this is a private conversation but I also would like to see
>>> some *simple* code for handling sound.
>>>
>>
>> Oh dear, I think I'm getting to the point of "There is no such thing".
>> I also think this might be material for a meet.
>>
>> I did not mean this to be a private conversation,
>>
>> From where I've got so far.
>>
>> 1. Sound is a stream of numbers that have to be passed to the sound
>> card very quickly, 44,100 means 44100 samples per second, so 88300
>> bytes per a second (two bytes per a sample)
>>
>> 2. The sound api basically allow access to the stream (or streams) and
>> allow the streams to be shared between multiple applications. (This of
>> it like a mixing desk)
>>
>> 3. There are about 15 different api and they all do slightly different
>> jobs.
>>
>> 4. Some of the api are very simple, low level but fast so you get
>> direct access to the stream, others give libraries for doing
>> "standard" stuff and give a more "high level" approach. so gstreamer
>> takes mp3 or ogg files and plays them, as does phonon, where as pulse
>> or portaudio take raw bit streams and though them out and expect you
>> to handle any decoding your self.
>>
>> 5. Volume and mixer levels are delt with sepately from the standard
>> input/output and not all of the simple api deal with them at all.
>>
>> I'm currently studying Jack think this might be the best of a bad bunch.
>>
>> Peter.
>
>
> libsndfile is a nice file-io library and widely used, although it does not
> handle mp3 (due to the patent issues) but does handle practically
> everything else. and it's API is very much like using the standard C
> system library calls, fopen, fread, fwrite etc, except worrying about file
> headers and offsets of the actual audio data, or even the format of the
> audio data is taken care of for you. libsndfile operates with floating
> point audio ( -1.0 ~ +1.0) though it has functions to read the audio data
> from the file into either float or integer data, etc, etc. see
> http://mega-nerd.com
>
> BTW, I've found the jack dev mailing list quite helpful and responsive and
> they're on IRC @ freenode.net as #jack
>
> james
>
>

I looked at Jack and I think I decided that while it looks good, it
does not play nicely with everything else...

libsndfile looks good. I've just got to find some way of connecting it
to the sound card, at this rate it will be either alsa or pulse.
unless somone can tell me how to get Jack to work (Under Ubuntu) and
mix with other audio programs....


Peter



More information about the Kent mailing list