Git Product home page Git Product logo

eeui-plugin-recorder's Introduction

录音机

安装

eeui plugin install https://github.com/aipaw/eeui-plugin-recorder

卸载

eeui plugin uninstall https://github.com/aipaw/eeui-plugin-recorder

引用

const recorder = app.requireModule("eeui/recorder");

start(options, callback) 开始录音

参数

  1. options (Object)

    • channel (String) (stereomono, default: stereo)

    • quality (String) (low [8000Hz, 8bit] | standard [22050Hz, 16bit] | high [44100Hz, 16bit], default: standard)

  2. [callback] (Function)

示例

recorder.start({
    channel: `mono`
}, () => {
    console.log('started')
})

pause(callback) 暂停录音

参数

  1. [callback] (Function)

示例

recorder.pause()
recorder.pause(() => {
    console.log('paused')
})

stop(callback) 结束录音

参数

  1. [callback] (Function)

返回

  1. result (Object)
    • path (String)

示例

recorder.stop((ret) => {
    console.log(ret.path)
})

format: "aac" (iOS) / "wav" (Android)


Error
RECORDER_INTERNAL_ERROR
RECORD_AUDIO_PERMISSION_DENIED
RECORD_AUDIO_INVALID_ARGUMENT
RECORDER_BUSY
RECORDER_NOT_STARTED

eeui-plugin-recorder's People

Contributors

aipaw avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

mrz9

eeui-plugin-recorder's Issues

安卓开始录音时报错

设备环境:Pixel 2 API 28 Android 9.0 x86

recorder.start时android studio报错如下:
image

recorder.stop时一直报这个错误:
{"error":{"message":"RECORDER_NOT_STARTED","code":130100}}

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.