Re: [LAD] using libsndfile to write signed short

From: Harry van Haaren <harryhaaren@email-addr-hidden>
Date: Sat Sep 27 2014 - 11:36:38 EEST

On Sat, Sep 27, 2014 at 6:11 AM, Joël Krähemann <weedlight@email-addr-hidden> wrote:
> Am I correct assuming 1 sample of stereo frames will be written 44100
> times by a rate of 44100 Hz audio sampled data?
Yes. Just to be 100% clear, a "sample" is a *single* point of data.

In a mono situation: a "frame" refers to the single sample for that channel.
In stereo: a "frame" refers to 2 samples, one for *each* channel.

So the difference between a frame and a sample is that a sample is
literally a single data point, while a frame is a single "data point"
for each channel.

> Whereby one sample contains 2 frames.
See above :)

> CHANNELS = 2
> buffer_size_per_second = CHANNELS * 44100 * sizeof(signed short);
Yep. The link below is useful for double checking, and for quick disk
space calculations:
http://www.sounddevices.com/calculator/

I've written a tutorial on using SndFile to write to disk: perhaps a
useful resource to check / play with:
https://github.com/harryhaaren/openAudioProgrammingTutorials/blob/master/writingSoundfileToDisk/writingSoundfileToDisk.cpp

HTH, -Harry

-- 
www.openavproductions.com
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Sat Sep 27 12:15:02 2014

This archive was generated by hypermail 2.1.8 : Sat Sep 27 2014 - 12:15:03 EEST