本文整理汇总了C++中file_info::info_set_bitrate方法的典型用法代码示例。如果您正苦于以下问题:C++ file_info::info_set_bitrate方法的具体用法?C++ file_info::info_set_bitrate怎么用?C++ file_info::info_set_bitrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类file_info
的用法示例。
在下文中一共展示了file_info::info_set_bitrate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_info
void get_info(file_info & p_info,abort_callback & p_abort) {
t_filesize size = m_file->get_size(p_abort);
if (size != filesize_invalid) {
//file size is known, let's set length
p_info.set_length(audio_math::samples_to_time( size / raw_total_sample_width, raw_sample_rate));
}
//note that the values below should be based on contents of the file itself, NOT on user-configurable variables for an example. To report info that changes independently from file contents, use get_dynamic_info/get_dynamic_info_track instead.
p_info.info_set_int("samplerate",raw_sample_rate);
p_info.info_set_int("channels",raw_channels);
p_info.info_set_int("bitspersample",raw_bits_per_sample);
p_info.info_set("encoding","lossless");
p_info.info_set_bitrate((raw_bits_per_sample * raw_channels * raw_sample_rate + 500 /* rounding for bps to kbps*/ ) / 1000 /* bps to kbps */);
}