Logo Search packages:      
Sourcecode: pulseaudio version File versions

size_t pa_usec_to_bytes ( pa_usec_t  t,
const pa_sample_spec spec 
)

Calculates the number of bytes that are required for the specified time. The return value will always be rounded down for non-integral return values.

Since:
0.9

Definition at line 92 of file sample.c.

References PA_USEC_PER_SEC, and pa_sample_spec::rate.

                                                                 {
    pa_assert(spec);
    pa_return_val_if_fail(pa_sample_spec_valid(spec), 0);

    return (size_t) (((t * spec->rate) / PA_USEC_PER_SEC)) * pa_frame_size(spec);
}


Generated by  Doxygen 1.6.0   Back to index