[Klug-general] Linux Sound Programming

James Morris james at jwm-art.net
Mon Mar 22 09:42:04 UTC 2010


On Mon, March 22, 2010 07:28, Thomas Edward Groves wrote:
> My point about books was originally on the
> point that if I want to record a sound input
> for 30 minutes and then have it stop itself then
> where am I going to find out that arecord
> will do that except by reading it or by
> asking someone?
> And given that replies to such questions don't
> seem to be too helpful (Peter Childs is still
> waiting) then contemptuous references to
> documentation suggest that books are a better
> bet.
> Note: books don't flame.

I've been programming on Linux for nearly ten years, not because it has
ever been my job, but because I want to. So when a claim that all the
documentation is wrong or out of date is put forward it seems rather off.

In fact the documentation for Linux, and the amount of resources of
documentation and help available online is seriously one of the things
I've always thought was so great about it! Not that it has never
frustrated me.

Perhaps the best method of learning how to use a specific library's API is
to find a simple application which does something similar to what you want
to do, and look at its source code - and then go to the documentation so
you can understand what function xyz does.

Probably this should in fact be this first port of call when you find the
documentation does not hold your hand and guide you through creating an
application using it - which is often the case.

KLUG is also not specifically programming or audio related. Don't just
wait for an answer here, go and find a list more likely to have the user
base where someone will know from experience how to do this.

In this case Linux Audio User or Linux Audio Developer will most likely be
able to help.

James.





> As for knowing about argv[1]: in any of
> my programs the first statement  is usually
> something like this
>
> if (argc < 2)
> {
> printf("you must provide <foobar>\n");
> exit(0);
> } /* failed to include argument */
>
> In the programs supplied by Kevin Groves
> (incidently thanks) argv[1] was simply used
> without any check on whether it had actually
> been set. A potentially nasty mistake.
>
> Lastly one of the reasons for leaving Windows
> was because the programming goalposts kept moving
> and the documentation was lousy.
> Linux is not much better.
>
> Tom Groves
>
> ----- Original Message -----
> From: James Morris <james at jwm-art.net>
> To: Kent Linux User Group - General Topics <kent at mailman.lug.org.uk>
Sent: Sunday, March 21, 2010 9:03 AM
> Subject: Re: [Klug-general] Linux Sound Programming
>
>
>> On Sun, March 21, 2010 06:34, Thomas Edward Groves wrote:
>> > Like comments in programs maybe?
>> >
>> > I'd like to see some of this "programming that doesn't need
> documentation"
>> > but I never have.
>> >
>> > Also it's all very well claiming that *you* don't need books but
where
> do
>> > I start on a new subject?
>> > Ask for a simple example and get a chunk of code that assumes that I
already
>> > know all the background?
>> Ok, I'm not saying I don't need books. I have several C programming books,
>> but none of them are Linux specific. I have one linux specific
>> programming
>> book, which occasionally came in useful, but for the most part is
completely out of date - the API's have changed, or what were standard
system tools (or standard API's) back when the book was written have
changed, or had major version updates, or have simply deprecated. Open
source software changes so fast it makes buying the books fairly
pointless
>> especially when there are so many sources of information online.
>> > Here's a generalisation for you: all Linux programmers are
>> complicators,
>> > not simplifiers.
>> >
>> > So don't just write good code, comment it lavishly.
>> > (Example for Kevin Groves: in your two programs what is ARGV[1]? It
*looks* like it's an audio device but in that case where is the
>> sound
>> > file?)
>> How much do you know? Do you know what an array is? Do you know how to
pass command line options to a C program? ARGV[1] is the 2nd element in
an
>> array called ARGV. I suspect it's a parameter to main() - ie an array
of
>> char strings made from the options passed to the program.
>> A programmer has to assume the reader of the code has a certain amount of
>> knowledge - the more complex a piece of code gets, only the important
stuff where it needs to be commented because the code does not make it
clear is commented - and this is more for the developer who wrote the
code
>> - he/she will comment it because they are aware they'll forget what it
does, and the comment will prevent them from mistakenly thinking it
does
>> something wrong etc.
>> A great place to ask programming questions and you'll usually get fast
responses, is stackoverflow.com
>> and the man pages, (in debian, glibc-doc-reference )
>> james.
>> > Apart from that: happy flaming folks.
>> > Tom
>> > ----- Original Message -----
>> > From: Peter Childs <peterachilds at gmail.com>
>> > To: Kent Linux User Group - General Topics <kent at mailman.lug.org.uk>
Sent: Saturday, March 20, 2010 6:08 PM
>> > Subject: Re: [Klug-general] Linux Sound Programming
>> >
>> >
>> >> On 20 March 2010 16:32, James Morris <james at jwm-art.net> wrote:
>> >> > On Sat, March 20, 2010 06:13, Thomas Edward Groves wrote:
>> >> >> So much for having a yard of books on Linux!
>> >> >>
>> >> >> Why is *all* documentation so out-of-date / wrong / misleading?
>> >> >
>> >> > A) that's a massive over generalization
>> >> > B) most people aren't interested in writing documentation
>> >> > C) books on linux are a utter waste of time and space
>> >> >
>> >> > james
>> >> >
>> >> >
>> >>
>> >> Its a skill that many Developers don't have and people see little
>> value
>> > in.
>> >>
>> >> Software is of continued usefulness to people, Documentation you
read
>> >> once and never read again if at all.
>> >>
>> >> The best programs are so well designed they don't need
documentation.
>> >>
>> >> (Three more massive over generalizations)
>> >>
>> >> Peter.
>> >>
>> >> _______________________________________________
>> >> Kent mailing list
>> >> Kent at mailman.lug.org.uk
>> >> https://mailman.lug.org.uk/mailman/listinfo/kent
>> >>
>> >>
>> >
>> >
>> > _______________________________________________
>> > Kent mailing list
>> > Kent at mailman.lug.org.uk
>> > https://mailman.lug.org.uk/mailman/listinfo/kent
>> >
>> _______________________________________________
>> Kent mailing list
>> Kent at mailman.lug.org.uk
>> https://mailman.lug.org.uk/mailman/listinfo/kent
>
>
> _______________________________________________
> Kent mailing list
> Kent at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/kent
>







More information about the Kent mailing list