Re: question of time (and frames)
Re: question of time (and frames)
- Subject: Re: question of time (and frames)
- From: William Stewart <email@hidden>
- Date: Mon, 3 Nov 2008 12:53:13 -0800
that's why we introduced the notion of a "frame" rather than samples.
So - a sample is a single value for one channel, whereas a frame is
the time co-incident collection of samples for the number of channels
represented by an audio stream. (So, for stereo, a frame of linear pcm
contains two samples - left/right, for 5.1, six samples - left, right,
centre, LFE, left surround, right surround)
Also - for linear pcm - silence is represented not by NULL pointers,
but by the required amount of data being set to zero.
Bill
On Nov 2, 2008, at 11:30 PM, Brian Willoughby wrote:
Right, the time only varies when you have a set number of 'bytes'
not 'frames.' If you allocate 512 bytes of buffering, then the
number of seconds of time will change as you switch from mono to
stereo to surround, or from 44.1kHz to 96kHz or 192kHz.
Brian Willoughby
Sound Consulting
On Nov 2, 2008, at 23:00, tahome izwah wrote:
Yes. As a matter of fact, the same is true for a stereo input, or a
multichannel input. 512 frames @ 44.1kHz are always 512/44100 seconds.
2008/11/2 John Clayton <email@hidden>:
so if the input notify callback requests 512 frames, and I've got
mono input
(1 channel) at 44.1khz, then 512 frames is equal to 512 / 44100.0
seconds,
correct?
On 2/11/2008, at 8:56 PM, tahome izwah wrote:
Generally, frames are samples that contain all channels. 1 stereo
frame = 2 samples. 1 5.1 surround frame = 6 samples. 1 mono frame
= 1
sample.
2008/11/2 John Clayton <email@hidden>:
Hope you've had a good weekend out there. Question re: time. I
want to
calculate the amount of time that some frames take up - and just
to make
sure that this simple task isn't something I've misunderstood -
my belief
is
that I can simply say:
1 seconds of time = # frames/samples per second
correct? More specifically, this is entirely independant of the
number
of
channels right? So if I wanted to simulate 13 seconds of
silence, I'd
just
return
13 * sample_rate_per_second
frames of null data from an input routine.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden