All Projects → akofman → cordova-plugin-dbmeter

akofman / cordova-plugin-dbmeter

Licence: Apache-2.0 license
🎤📣 Cordova plugin to get decibels from the microphone

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language
swift
15916 projects

Projects that are alternatives of or similar to cordova-plugin-dbmeter

cordova-plugin-webpack
Integrate webpack into your Cordova workflow.
Stars: ✭ 61 (+84.85%)
Mutual labels:  cordova, cordova-plugin
cordova-fonts
Cordova plugin for enumerating fonts on a mobile device
Stars: ✭ 14 (-57.58%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Audioinput
This iOS/Android Cordova/PhoneGap plugin enables audio capture from the device microphone, by in near real-time forwarding audio to the web layer of your application. A typical usage scenario for this plugin would be to use the captured audio as source for a web audio node chain, where it then can be analyzed, manipulated and/or played.
Stars: ✭ 137 (+315.15%)
Mutual labels:  cordova, cordova-plugin
ionic-hockeyapp
Need HockeyApp in your Ionic application, add this package!
Stars: ✭ 19 (-42.42%)
Mutual labels:  cordova, cordova-plugin
hms-cordova-plugin
This repo contains all of Cordova HMS plugins.
Stars: ✭ 78 (+136.36%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Wkwebview File Xhr
Cordova Plugin for WebView File XHR
Stars: ✭ 116 (+251.52%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Fingerprint Aio
👆 📱 Cordova Plugin for fingerprint sensors (and FaceID) with Android and iOS support
Stars: ✭ 236 (+615.15%)
Mutual labels:  cordova, cordova-plugin
Unityionicintegration
A guide to integrating Unity 3D content into an Ionic app and sending messages between them (for Android & iOS)(tested with Vuforia plugin)
Stars: ✭ 94 (+184.85%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-purchases
Cordova in-app purchases and subscriptions made easy.
Stars: ✭ 52 (+57.58%)
Mutual labels:  cordova, cordova-plugin
JiaCordova
在Cordova及插件的基础上封装一些常用的功能,不断更新中
Stars: ✭ 35 (+6.06%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Add Swift Support
🔨 Swiftify your Cordova app !
Stars: ✭ 108 (+227.27%)
Mutual labels:  cordova, cordova-plugin
cordova-line-login-plugin
A cordova plugin for easy implementation of LINE login using LineSDK.
Stars: ✭ 20 (-39.39%)
Mutual labels:  cordova, cordova-plugin
Wifiwizard2
A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+
Stars: ✭ 106 (+221.21%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-downloadmanager
A Cordova plugin to download file in system's default download manager
Stars: ✭ 45 (+36.36%)
Mutual labels:  cordova, cordova-plugin
Cordova Broadcaster
Cordova Plugin to allow message exchange between javascript and native (and viceversa)
Stars: ✭ 104 (+215.15%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Touch Id
💅 👱‍♂️ Forget passwords, use a fingerprint scanner!
Stars: ✭ 209 (+533.33%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Remote Injection
DEPRECATED: Cordova plugin to allow a remote site to interact with cordova's javascript APIs when loaded within a cordova app.
Stars: ✭ 90 (+172.73%)
Mutual labels:  cordova, cordova-plugin
Google Analytics Plugin
Cordova Google Analytics Plugin for Android & iOS
Stars: ✭ 90 (+172.73%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-android-window-background
Simple Cordova plugin to set Android window background on start-up 🎨 🍭
Stars: ✭ 15 (-54.55%)
Mutual labels:  cordova, cordova-plugin
cordova-study
📱 Cordova学习记录,Cordova插件的使用,热更新、media、device、集成x5内核等等。
Stars: ✭ 19 (-42.42%)
Mutual labels:  cordova, cordova-plugin

Twitter: @alexiskofman License Build Status

cordova-plugin-dbmeter

This plugin defines a global DBMeter object, which permits to get the decibel values from the microphone. Although the object is in the global scope, it is not available until after the deviceready event.

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
    DBMeter.start(function(dB){
        console.log(dB);
    });
}

Installation

cordova plugin add cordova-plugin-add-swift-support
cordova plugin add cordova-plugin-dbmeter

The iOS part is written in Swift so the Swift support plugin is needed.

Supported Platforms

  • iOS
  • Android

iOS Quirks

Since iOS 10 it's mandatory to provide an usage description in the info.plist if trying to access privacy-sensitive data. When the system prompts the user to allow access, this usage description string will displayed as part of the permission dialog box, but if you didn't provide the usage description, the app will crash before showing the dialog. Also, Apple will reject apps that access private data but don't provide an usage description.

This plugins requires the following usage description:

  • NSMicrophoneUsageDescription describes the reason the app accesses the user's microphone.

To add this entry into the info.plist, you can use the edit-config tag in the platform section of your config.xml like this:

<edit-config target="NSMicrophoneUsageDescription" file="*-Info.plist" mode="merge">
    <string>need microphone access to record sounds</string>
</edit-config>

Methods

DBMeter.start(success, error)

start listening.

DBMeter.start(function(dB){
  console.log(dB);
}, function(e){
  console.log('code: ' + e.code + ', message: ' + e.message);
});

DBMeter.stop(success, error)

stop listening.

DBMeter.stop(function(){
  console.log("DBMeter well stopped");
}, function(e){
  console.log('code: ' + e.code + ', message: ' + e.message);  
});

⚠️ If the DBMeter is stopped while is not listening, an error will be triggered and can be handle from the second callback argument.

DBMeter.isListening(success, error)

retrieve from the success callback whether the DBMeter is listening.

DBMeter.isListening(function(isListening){
  console.log(isListening);
});

DBMeter.delete(success, error)

delete the DBMeter instance.

DBMeter.delete(function(){
  console.log("Well done !");
}, function(e){
  console.log('code: ' + e.code + ', message: ' + e.message);  
});

⚠️ If the DBMeter has not been started once before deleting, an error will be triggered and can be handle from the second callback argument.

App

An app is available in the app folder and is generated from the Cordova Plugin Test Framework. It permits to launch auto tests and manual tests.

To install it, please follow these steps :

cd app && cordova platform add android|ios
cordova run android|ios --device
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].