我怎么能确定一个特定的文件实际上是一个MP3文件? [英] How can I determine that a particular file is in fact an MP3 file?
本文介绍了我怎么能确定一个特定的文件实际上是一个MP3文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎么能确定一个特定的文件(这可能会或可能不会有一个.MP3文件扩展名),其实是一个MP3文件?我希望做这在C#。
解决方案
- 使用文件扩展名是不可靠的。
- 您可以用最好的libary是 https://github.com/mono/标签库锐它检测到的最常见的文件类型。你也许只想MP3,这样你就可以提取任何MP3相关的类。
- 您可以使用一个简单的库的 https://github.com/judwhite/IdSharp
How can I determine that a particular file (which may or may not have an ".mp3" file extension) is in fact an MP3 file? I wish to do this in C#.
解决方案
- using file extension is not reliable.
- the best libary you can use is https://github.com/mono/taglib-sharp it detects most of the common file types. maybe you just want mp3, so you can extract any mp3 related class.
- a simpler library you can use is https://github.com/judwhite/IdSharp
这篇关于我怎么能确定一个特定的文件实际上是一个MP3文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文