我使用vorbis.c在C++中加载/解码.ogg音频文件。如何获得剪辑的持续时间(秒)?
发布于 2015-08-09 10:51:58
您可以使用stb_vorbis_stream_length_in_seconds函数,它以stb_vorbis_open_file调用的结果作为参数。这是一个关于如何使用它的示例。
发布于 2015-08-09 07:08:46
您可以使用libsndfile http://www.mega-nerd.com/libsndfile/ http://www.mega-nerd.com/libsndfile/api.html
易于使用和简单的例子。您应该使用以下命令打开文件: SNDFILE* sf_open (const *path,int模式,SF_INFO * sfinfo );然后使用这个变量sfinfo,您可以使用
sfinfo->样品和sfinfo->sf_count_t
https://stackoverflow.com/questions/27884911
复制相似问题