Question Detail

How to get duration of an audio file in wav format

5 years ago Views 1297 Visit Post Reply

I am having a database which has 15 audio file records.

while displaying i want to show duration of the audio file seperatly.

Please guide me how to get this thing done.

Note : Urgently Required .


Thread Reply

Anonymous

- 5 years ago

On which platform do you want to do this?

Please elaborate which technology you are using.

Hemant Sharma

- 5 years ago

follow the below code to get Audio file duration in Android :

MediaPlayer mplay = MediaPlayer.create(yourActivity, Uri.parse(YOUR_AUDIO_FILE_PATH));
int duration = mplay.getDuration();

Hemant Sharma

- 5 years ago

follow the below code to get Audio file duration in Android :

MediaPlayer mplay = MediaPlayer.create(yourActivity, Uri.parse(YOUR_AUDIO_FILE_PATH));
int duration = mplay.getDuration();