akofman / cordova-plugin-dbmeter Goto Github PK
View Code? Open in Web Editor NEW:microphone::mega: Cordova plugin to get decibels from the microphone
License: Apache License 2.0
:microphone::mega: Cordova plugin to get decibels from the microphone
License: Apache License 2.0
To have this plugin installed (without using it or even mentioning it in config.xml) is enough to create a build fail for iOS but for iOS only (for android the problemes come after with a blacked screen).
Here is some of the error outputs
** BUILD FAILED **
The following build commands failed:
CompileSwift normal i386 /Users/Workfluo/ionic-server/wad/platforms/ios/What a Day/Plugins/cordova-plugin-dbmeter/DBMeter.swift
CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler
(2 failures)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Workfluo/ionic-server/wad/platforms/ios/cordova/build-debug.xcconfig,-project,What a Day.xcodeproj,ARCHS=i386,-target,WaD,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/Workfluo/ionic-server/wad/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/Workfluo/ionic-server/wad/platforms/ios/build/sharedpch
Hi,
can you please provide support for the browser platform?
It would be sufficient for me if some random decibel values would be reported.
I tried to add support on my own in my fork of your project but did not get it to work in the test app:
https://github.com/aabeling/cordova-plugin-dbmeter
Don't know what I am missing.
I followed the tutorial https://moduscreate.com/blog/supporting-the-browser-platform-in-a-cordova-plugin/.
Best regards
Achim
[11:55:36]: ▸ ❌ /Users/ionic/builds/XXX/XXX/ios/capacitor-cordova-ios-plugins/sources/CordovaPluginDbmeter/DBMeter.swift:75:50: 'AVAudioSessionCategoryRecord' has been renamed to 'AVAudioSession.Category.record'
[11:55:36]: ▸ try audioSession.setCategory(AVAudioSessionCategoryRecord)
[11:55:36]: ▸ ^~~~~~~~~~~~~~~~~ ~~~~~~~~
[11:55:36]: ▸ ** ARCHIVE FAILED **
[11:55:36]: ▸ The following build commands failed:
[11:55:36]: ▸ CompileSwift normal arm64 /Users/ionic/builds/XXX/XXX/ios/capacitor-cordova-ios-plugins/sources/CordovaPluginDbmeter/DBMeter.swift
[11:55:36]: ▸ CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
[11:55:36]: ▸ CompileSwift normal arm64
[11:55:36]: ▸ (3 failures)
Hi,
I found a problem, once DBMeter.start is called, the volume +/- button on iPhone are not working any more.
Even after DBMeter.stop or .delete is called, still don't work.
Could you please have a check on this?
Thank you for your great work.
I get this error:
Check dependencies
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
** ARCHIVE FAILED **
My config:
<gap:plugin name="cordova-plugin-add-swift-support" source="npm"/>
<preference name="UseLegacySwiftLanguageVersion" value="true" />
<gap:plugin name="cordova-plugin-dbmeter" source="npm"/>
Hey!
I noticed that the counter is limited to 90 for me, and when the dB is higher than that, it just freezes at 90. Is that a bug, or some proposital thing?
Thanks anyway, love that plugin!
When calling DBMeter.start()
multiple times (accidentally or on purpose) the resulting dB value will always be -70.
I would suggest, throwing an error, on multiple starts.
My setup was:
const dummy = {
dB: 0,
isListening: false,
startMeter() {
const $this = this;
setInterval(() => {
if (!this.paused) {
if (!this.isListening) {
DBMeter.isListening((isListening) => {
this.isListening = isListening;
if (!isListening) {
DBMeter.start(_.throttle($this.recordMeter, 100), $this.errorLog);
}
}, $this.errorLog);
return;
}
// update stuff with this.db
}
}, 100);
},
recordMeter(dB) {
this.dB = dB;
},
errorLog(e) {
// log
}
};
On iOS the first few intervals DBMeter.isListening() passes false
so i told the system to start again.
After like 0.3 to 1 second DBMeter.isListening() passes true.
Hello, while dbmeter is listening, apache/cordova-plugin-media creates empty files. media.startRecord() and media.stopRecord() are not throwing exceptions. When dbmeter is not listening everything works well.
Spec.: ionic 3.12.0, cordova 6.5.0, ionic-angular 3.3.0, Android 6.1.2 platform.
ionic-native/media
Unable to get microphone at the same time
Hi,
is it possible to compare a volume from microphone ? something like low or high volume from microphone directly when we speak (ios cordova)
thanks
Hello,
Thank you for this plugin. It works perfectly on android for me, but i've found a problem wih IOS. I can build my project with Xcode 8.2 without errors, but when I run in debug mode, I get the above message in DBMeter.swift - private func timerCallBack() -
In release mode it simply crash.
I got this error after i chnaged build settings optimization to none
because with default values i have this error while bulding:
was compiled with optimization - stepping may behave oddly; variables may not be available
Many thanks for your support
Hi everyone, i'm using this plugin for an Android app, and sometimes in my google developer console i can see that on some devices the app crashes with this stack:
java.lang.NullpointerException:
at org.apache.cordova.dbmeter.DBMeter$1$1.run
at java.util.TimerThread.mainLoop
at java.util.TimerThread.run
Can you please help me?
Is there a newer version of this plugin? I don't think it is accurate though it returns results straight out of the box.
after doing a DBMeter.delete(callback, errorLog);
the use of DBMeter.start(callback, errorLog);
has inconsistent behavior on Android and iOS.
On Android the DBMeter will be restartet and is listening.
On iOS the DBMeter wont be restartet, and does not throw an error.
I'd love to have a consistent behavior here. So you can rely on both platforms on the delete feature.
Hi everyone, I am trying to run the following code :
let subscription = this.dbMeter.start().subscribe(
data => console.log(data)
);
but I have this following error :
[ng] [console.warn]: "Native: tried calling DBMeter.start, but the DBMeter plugin is not installed."
[ng] [console.warn]: "Install the DBMeter plugin: 'ionic cordova plugin add cordova-plugin dbmeter'"
[ng] [console.warn]: "Native: tried calling DBMeter.stop, but the DBMeter plugin is not installed."
[ng] [console.warn]: "Install the DBMeter plugin: 'ionic cordova plugin add cordova-plugin-dbmeter'"
[ng] [console.error]: "ERROR" "plugin_not_installed"
here is the installation i did :
cordova plugin add cordova-plugin-add-swift-support
cordova plugin add cordova-plugin-dbmeter
npm install @ionic-native/db-meter
I put the following code in the config.xml file in the platform (ios) tag:
"
need microphone access to record sounds
"
and I did not forget to add in the providers "DBMeter" so I really don't understand the error
Can you please help me? (thank you)
I’m implementing cordova-plugin-dbmeter through the Ionic Native wrapper (@ionic-native/db-meter). It works fine on Android, but on iOS, the plugin crashed when initialized. It builds fine in Xcode, though. And all other plugins (Capacitor, Ionic Native, Cordova) works just fine.
The error message I get is:
CordovaPlugins/DBMeter.swift:5: Fatal error: Use of unimplemented initializer ‘init(webViewEngine:)’ for class ‘CordovaPlugins.DBMeter’
And here it crashes:
I’ve tried using the plugin without the wrapper, but no success. I read that the plugin requires cordova-plugin-add-swift-support, but Capacitor doesn’t support the plugin cordova-plugin-add-swift-support and should provide the necessary Swift support anyway.
Anyone has got this to work, or have any ideas? Getting lots of gray hair over this.
cordova-plugin-dbmeter no provider in Ionic 2 Application
import { DBMeter } from '@ionic-native/db-meter';
constructor(public platform: Platform, public dbMeter: DBMeter) {}
and in class ...
// Start listening
let subscription = this.dbMeter.start().subscribe(
data => this.currentAmplitude = data
);
Gives this error!
Runtime Error
Error in ./MyApp class MyApp - inline template:19:0 caused by: No provider for DBMeter!
Stack
Error: No provider for DBMeter!
at NoProviderError.BaseError [as constructor] (http://localhost:8100/build/main.js:8347:34)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:8100/build/main.js:52946:16)
at new NoProviderError (http://localhost:8100/build/main.js:52977:16)
at ReflectiveInjector_._throwOrNull (http://localhost:8100/build/main.js:98815:19)
at ReflectiveInjector_._getByKeyDefault (http://localhost:8100/build/main.js:98843:25)
at ReflectiveInjector_._getByKey (http://localhost:8100/build/main.js:98806:25)
at ReflectiveInjector_.get (http://localhost:8100/build/main.js:98615:21)
at AppModuleInjector.NgModuleInjector.get (http://localhost:8100/build/main.js:53648:52)
at CompiledTemplate.proxyViewClass.AppView.injectorGet (http://localhost:8100/build/main.js:99357:45)
at CompiledTemplate.proxyViewClass.DebugAppView.injectorGet (http://localhost:8100/build/main.js:99599:49)
Ionic Framework: 2.1.0
Ionic Native: 2.4.1
Ionic App Scripts: 1.1.3
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 7.2.1
OS Platform: Windows 8.1
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36
Any solutions on this? I´m missing something ?
Thankx a lot
unfortunately, this plugin creator @akofman , did fantastic work, and we highly appreciate him not maintaining this plugin anymore (not responding for a while).
we moved to a maintained plugin (which forked from this one) to here:
https://github.com/EYALIN/community-cordova-plugin-dbmeter
you can install it as an npm package:
cordova plugin add community-cordova-plugin-dbmeter --save
Hello,
Thank you for this cool plugin. We've used it to build a Cordova app detecting people breath.
It is working as expected in Androïd, and for iOS only in debug version. We are going to publish the app on the app store and when we want to build the release version, Xcode 8.3 wants us to upgrade to Swift 3 :/
After doing the upgrade, we have the following errors :
Is there a way to resolve that and publish the app ? ... we are really annoyed (thanks Apple grrr...)
Thanks in advance !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.