Pages

Thursday, February 6, 2014

My adventures on playing and looping sounds on android, part 3

Intent

During my adventures I bumped into some definitions. I'll try to explain some of those. 
  • Sample rate
  • Bit depth
  • Channels
  • Bit rate

 

Sample rate

The number of samples required for a second of digital sound. A stream (digital payload) consists of samples. You can imagine that a sample is a unit for the movement of a membrane that vibrates the air in your surrounding area, from your sound amplification device.

 

Bit depth

Depth defines the digital sonic resolution (think: dimensional resolution for screens, but in this case digital sound) or quality and/or fidelity of a single sample.

 

Channels

Channels are the number of tracks on a stream (digital payload) so that each may have different sonic content on them, e.g. track 1 for drums and bass, track 2 for guitars and violins.

 

Bit rate

Bit rate = sample rate x bit depth x channels

For instance the bit rate of a mono channel, 16 byte bit depth, 44.1kHz sample rate, audio file is 88200. Which also means that for each second of digital sound, 88200 bytes are required to be filled with data. Or silence will ensue...

Why is this useful ? You can use this to calculate how much data is required to play a certain length of sound for these specific parameters (sample rate, depth, no. of channels).

To play a sound for 77 milliseconds, in my previous example, it will require 6834 bytes of data, i.e. 88200 x 0.077 = 6834 bytes.

The End

No comments:

Post a Comment

Please help to keep this blog clean. Don't litter with spam.