Beispiel #1
0
unsigned file_info::info_get_decoded_bps()
{
	__int64 val = info_get_int("decoded_bitspersample");
	if (is_valid_bps(val)) return (unsigned)val;
	val = info_get_int("bitspersample");
	if (is_valid_bps(val)) return (unsigned)val;
	return 0;
}
Beispiel #2
0
__int64 file_info::info_get_length_samples() const
{
	__int64 ret = 0;
	double len = get_length();
	__int64 srate = info_get_int("samplerate");

	if (srate>0 && len>0)
	{
		ret = dsp_util::duration_samples_from_time(len,(unsigned)srate);
	}
	return ret;
}
t_int64 file_info::info_get_length_samples() const
{
    t_int64 ret = 0;
    double len = get_length();
    t_int64 srate = info_get_int("samplerate");

    if (srate>0 && len>0)
    {
        ret = audio_math::time_to_samples(len,(unsigned)srate);
    }
    return ret;
}