Logo Search packages:      
Sourcecode: pulseaudio version File versions

pa_usec_t pa_bytes_to_usec ( uint64_t  length,
const pa_sample_spec spec 
)

Calculate the time the specified bytes take to play with the specified sample type. The return value will always be rounded down for non-integral return values.

Definition at line 85 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 (((pa_usec_t) (length / pa_frame_size(spec)) * PA_USEC_PER_SEC) / spec->rate);
}


Generated by  Doxygen 1.6.0   Back to index