Example usage for org.apache.cordova AudioPlayer getDuration

List of usage examples for org.apache.cordova AudioPlayer getDuration

Introduction

In this page you can find the example usage for org.apache.cordova AudioPlayer getDuration.

Prototype

public float getDuration(String file) 

Source Link

Document

Get the duration of the audio file.

Usage

From source file:com.candygram.media.AudioHandler.java

License:Apache License

/**
 * Get the duration of the audio file./*  w w  w.  j  a va2s.  com*/
 * @param id            The id of the audio player
 * @param file            The name of the audio file.
 * @return               The duration in msec.
 */
public float getDurationAudio(String id, String file) {
    AudioPlayer audio = getOrCreatePlayer(id, file);
    return audio.getDuration(file);
}