Giter Site home page Giter Site logo

androidsoundrecorder's Introduction

SoundRecorder

这是一个android4.4.4上的录音源码, 这个程序是供其它APP调用的,
因为这个activity在manifest中配置是没有launcher的,只有一个main入口, 后来自己加了一个launcher的category

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

case R.id.acceptButton:
    mRecorder.stop();
    /**
     * 这个项目, 本来就是为其它项目服务的. 因为这个项目本来就不是launcher, 仅仅有一个main入口
     */
    saveSample();
    //finish();
    break;


/*
 * If we have just recorded a smaple, this adds it to the media data base
 * and sets the result to the sample's URI.
 */
private void saveSample() {
    if (mRecorder.sampleLength() == 0)
        return;
    Uri uri = null;
    try {
        uri = this.addToMediaDB(mRecorder.sampleFile());
    } catch(UnsupportedOperationException ex) {  // Database manipulation failure
        return;
    }
    if (uri == null) {
        return;
    }
    setResult(RESULT_OK, new Intent().setData(uri));
}

androidsoundrecorder's People

Contributors

githubronda avatar

Watchers

James Cloos avatar C++ avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.