sox file.wav -r 10 file.dat
Asked Answered
S

1

6

What does a sample of a audio file contain ?

When I run the command "sox file.wav -r 10 file.dat", the output is something like

; Sample Rate 10
; Channels 2
           0    0.00085449219   -0.0007019043
         0.1       0.01348877    -0.011260986
         0.2      0.015930176    -0.013214111
         0.3      0.014923096    -0.012390137
         ...      ...            ...

I know the first column is time the second and third column stand for the 2 channels.

But I would like to know is what does the channel value contain ?

Sapor answered 20/12, 2010 at 7:22 Comment(3)
Can you change this to proper English? I think you want to say: "I know each value IS a sample. But WHAT does a sample contain?".Thermoelectrometer
This is still not a very good expression of your question. I happened to have see you previous question, so I know what your are up to, but anyone else has NO IDEA of what you mean, by what you have written as a question. If you don't change it to a proper text soon, I (or somebody else) will down-vote it!!!Thermoelectrometer
Thanks again, I have redone it.Sapor
T
6

Have a look here: http://www.hardwaresecrets.com/article/317. In short...if you think of a membrane of a loudspeaker, each sample is a measure of the position of the membrane at a moment in time. E.g. for that reason a sample does not represent the sound level directly. However the level of the audio signal can be calculated with the sample information, e.g. implementing a peak program meter algorithm: http://en.wikipedia.org/wiki/Peak_programme_meter

Thermoelectrometer answered 20/12, 2010 at 10:33 Comment(4)
I kind of get what you mean, although is there a way I can calculate the amplitude from a 'SoX' sample ? Since I plan to use that to make a waveform for an audio file.Sapor
the 'SoX' sample is the amplitude of your audio signal. 'SoX' sample = amplitude, waveform = sequence of amplitudes ('SoX' sample). When you are looking at the samples your are looking at the waveform. x-axis is the time (1.column), y-axis is the amplitude (2.column LEFT, 3. column RIGHT).Thermoelectrometer
Yep. Now it makes sense. Therefore If I need to make an sound waveform (but which represents the volume e.g. soundcloud.com/dawnbrian5/photograph-katie-by-brian-clayton). How would I go about doing that ?Sapor
That waveform does not(!) represent the volume. Volume is always > 0.0. The example you gave is an illustration of the actual waveform. By looking at it, you can however see the volume, by interpreting the amplitude in both directions as loudness and not considering the little differences but look more at the rough outline. That is in deed the volume. But what you want is a display of the waveform with lower resolution. Maybe this helps: codeidol.com/java/swing/Audio/Build-an-Audio-Waveform-Display (Oh and if you want to keep getting help you might consider up-voting helpful answers)Thermoelectrometer

© 2022 - 2024 — McMap. All rights reserved.