npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-audio-recorder-plugin

v0.0.1

Published

A Cordova plugin to record audio

Downloads

15

Readme

Cordova audio recorder plugin

A Cordova plugin to record audio .

cordova plugin add https://github.com/mohamad-wael/cordova-audio-recorder-plugin.git

Plugin Concepts

The plugin cordova audio recorder , can be used to record audio , on android and iOS . This plugin , provides an api , which is accessible , using the global object cordova.plugins.audioRecorder .

The api , consists of two functions , one for performing the recording , and one for stopping it .

For recording , the cordova.plugins.audioRecorder.audioCapture_Start function , can be used , it has the following signature :

cordova.plugins.audioRecorder.audioCapture_Start(audioCapture_Ended , audioCapture_Failed , audioCapture_duration )
/*
audioCapture_duration : 
    Number of seconds to perform audio
    recording . If non is provided , 
    the default is 60 seconds . 
audioCapture_Ended : 
    call back function , called when the
    amount of time allocated for recording , 
    audioCapture_duration , has elapsed . 
    It receives as argument , a String 
    containing the path of the recorded 
    m4a audio file .
    If cordova.plugins.audioRecorder.audioCapture_Stop 
    is  called , while performing recording , 
    then the registered methods ,
    using this function , are not called  , 
    instead the registered functions , using 
    cordova.plugins.audioRecorder.audioCapture_Stop
    are called .    
audioCapture_Failed : 
    If any error happens during the 
    act of performing the recording , 
    this method is called . It is passed.   
    a String , detailing the error .*/

To stop the recording, it is either stopped automatically , after the set amount of time has elapsed , or it can be stopped at any time , using the cordova.plugins.audioRecorder.audioCapture_Stop method ,which has the following signature :

cordova.plugins.audioRecorder.audioCapture_Stop(audioCapture_Ended , audioCapture_Failed )
/*
audioCapture_Ended : 
   call back function , called when successfully , 
   the audioCapture_Stop function , stopped the
   recording of the audio file . 
   audioCapture_Ended receives as argument , a 
   String containing the path to the recorded file . 
audioCapture_Failed : 
   Called when performing the recording has 
   failed . 
   It receives as an argument , a String , detailing 
   the error .*/

The recorded audio file is an m4a audio file , it is saved in the cache directory , of an application . The cache directory , might be emptied by the system , on low storage . Hence , for permanent storage , the recorded files , must be copied elsewhere .

For iOS , in the config.xml file , found in the root of the application , the following must be added , in between the widget element :

<edit-config file="*-Info.plist" mode="merge" target="NSMicrophoneUsageDescription">
    <string>Describe why microphone permission is needed</string>
</edit-config>

Demo app

A tutorial , about creating a demo application , can be found here .