Re: [LAD] using libsndfile to write signed short

From: Joël Krähemann <weedlight@email-addr-hidden>
Date: Sat Sep 27 2014 - 13:34:38 EEST

On sab, 2014-09-27 at 09:36 +0100, Harry van Haaren wrote:
> On Sat, Sep 27, 2014 at 6:11 AM, Joël Krähemann <weedlight@gmail.com> 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
>
Do you know that WAV is interleaved? Currently I'm looking for something
like encoding multi-channel sources.

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Sat Sep 27 16:15:01 2014

This archive was generated by hypermail 2.1.8 : Sat Sep 27 2014 - 16:15:01 EEST