有没有一种方法来确定一个音频文件的持续时间 [英] Is there a way to determine the duration of an audio file

查看:85
本文介绍了有没有一种方法来确定一个音频文件的持续时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android的,什么是确定的音频文件的持续时间最简单的方法(假设我在手机上的文件的URI)?

In android, what is the simplest way to determine the duration of an audio file (assume I have an URI of the file on the phone)?

我是否需要创建和prepare的媒体播放器,我想确定文件的持续时间每个文件?

Do I need to create and prepare an media player for each file I want to determine the duration of the file?

感谢你。

推荐答案

如果MediaScanner是在手机上运行,​​那么你可以使用MediaStore来获得这些信息。

If MediaScanner is running on the phone then you can use MediaStore to get that information.

MediaStore

这篇关于有没有一种方法来确定一个音频文件的持续时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆