Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.io.File;
import java.io.FileInputStream;

import android.media.MediaPlayer;

public class Main {
    public static void playRecordAction(File audiofile) throws Exception {
        MediaPlayer mp = new MediaPlayer();
        FileInputStream fis = new FileInputStream(audiofile.getAbsolutePath());
        mp.setDataSource(fis.getFD());
        mp.prepare();
        fis.close();
        mp.start();
    }
}