Question: I have recently started going through sound card drivers in Linux[ALSA].

Can a link or reference be suggested where I can get good basics of Audio like :

Sampling rate,bit size etc.

I want to know exactly how samples are stored in Audio files on a computer and reverse of this which is how samples(numbers) are played back.

Answer: 
The [Audacity](http://audacity.sourceforge.net/) [tutorial](http://audacity.sourceforge.net/manual-1.2/tutorial_basics_1.html) is a good place to start. Another [introduction](http://www.pgmusic.com/tutorial_digitalaudio.htm) that covers similar ground. The [PureData](http://puredata.info/) [tutorial at flossmanuals](http://en.flossmanuals.net/pure-data/ch003_what-is-digital-audio/) is also a good starting point. [Wikipedia](http://en.wikipedia.org/wiki/Digital_audio) is a good source once you have the basics down.

Audio is input into a computer via an [analog-to-digital](http://en.wikipedia.org/wiki/Analog-to-digital_converter) converter (ADC). Digital audio is output via a [digital-to-analog](http://en.wikipedia.org/wiki/Digital-to-analog_converter) converter (DAC).

Sample rate is the number of times per second at which the analog signal is measured and stored digitally. You can think of the sample rate as the time resolution of an audio signal. Bit size is the number of bits used to store each sample. You can think of it as analogous to the color depth of an image pixel.

[David Cottle's](http://www.music.utah.edu/faculty/faculty_a-z/david_michael_cottle) [SuperCollider](http://supercollider.sourceforge.net/) book also has a [great introduction](http://supercolliderbook.net/) to digital audio.
I was in the same situation, and certainly this kind of information is out there but you need to do some research first. This is what I have found:
Digital Audio processing is a branch of DSP (Digital Signal
Processing).

> 
> DSP is one of the most powerful technologies that will
> shape science and engineering in the twenty-first century.
> Revolutionary changes have already been made in a broad range of
> fields: communications, medical imaging, radar & sonar, high fidelity
> music reproduction, and oil prospecting, to name just a few. Each of
> these areas has developed a deep DSP technology, with its own
> algorithms, mathematics, and specialized techniques…
> 
> 
> 

This quote was taken from a very helpful guide that covers every topic in depth called the “**The Scientist and Engineer's Guide to
Digital Signal Processing**”. And though you are not asking for DSP specifically there’s a chapter that covers all digital audio related topics with a very good explanation.

You can find it in the [chapter 22 - Audio Processing](http://www.dspguide.com/ch22.htm), and covers all this topics:

* Human Hearing: how the sound is perceived by our ears, this is the
basis of how then the sound is then generated artificially.
* Timbre: explains the properties of sound, like loudness, pitch and
timbre.
* Sound Quality vs. Data Rate: once you know the previous concepts
we start to translate it to the electronic side.
* High Fidelity Audio: gives you a picture of how sound is then
processed digitally.
* Companding: here you can find how sound is then processed and
compressed for telecommunications.
* Speech Synthesis and Recognition: More processes applied to the
sound, like filters, synthesis, etc.
* Nonlinear Audio Processing: this is more advanced but understandable,
for sound treatment and other topics.

It explains the basics of sound in the real world, in case you might want to take a look, and then it explains how the sound is processed in the computer including what you are asking for.

But there are other topics that can be found in wikipedia that are more specific, let’s say the “[Digital audio](https://en.wikipedia.org/wiki/Digital_audio)” page that explains every detail of this topic, this site can be used as a reference for further research, just in the beginning you can find a few links to sample rate, sound waves, digital forms, standards, bit depth, telecommunications, etc. There are a few things you might need to study more, like the nyquist-shannon theorem, fourier transforms, complex numbers and so on, but this is only used in very specific and advanced topics that you might not review or use. But I mention it just in case you are interested. You can find information in both the DSP guide book and wikipedia although you need to study some math.

I’ve been using python to develop and study these subjects with code since it has a lot of useful libraries, like numpy, sound device, scipy, etc. And then you can start plating with sound. On youtube you can find lots of videos that also guide you on how to do this. I’ve found synthesis, filters, voice recognition, you can create wav files with just code, which is great. But also I’ve seen projects in C/C++, Javascript, and other languages, so it might help you to keep learning and coding fun things.

There are a few other references across the internet but you might need to know what you are looking for, this book and the wikipedia page would be the best starting points for me, since it gives you the basics and explains in depth every topic. Then depending on the goal you want to achieve you can then start looking for more information.