cordova = require('cordova');
exec = require('cordova/exec');


function MicrophoneLevels() {
    this.cordova = null;
}

MicrophoneLevels.prototype.start = function() {
    exec(null, onError, "MicrophoneLevels", "start", null);
};

MicrophoneLevels.prototype.stop = function() {
    exec(null, onError, "MicrophoneLevels", "stop", null);
};

MicrophoneLevels.prototype.levels = function() {
    exec(onLevels, onError, "MicrophoneLevels", "levels", null);
};

var onLevels = function(params) {
    console.log(params);
}

var onError = function(err) {
    console.log("Error");
    console.log(err);
};

module.exports = new MicrophoneLevels();
@@ -55,16 +55,56 @@
 exec');%0A
+channels = require('cordova/channels');%0A
 %0A%0Afuncti
@@ -152,17 +152,121 @@
 = null;%0A
-%7D
+    this.channels = %7B%0A      %09microphonelevels:cordova.addWindowEventHandler(%22microphonelevels%22)%0A    %7D;%0A%7D;
 %0A%0AMicrop
@@ -360,20 +360,19 @@
 start%22, 
-null
+%5B%5D%5D
 );%0A%7D;%0A%0AM
@@ -469,20 +469,19 @@
 %22stop%22, 
-null
+%5B%5D%5D
 );%0A%7D;%0A%0AM
@@ -586,20 +586,19 @@
 evels%22, 
-null
+%5B%5D%5D
 );%0A%7D;%0A%0Av
@@ -655,16 +655,71 @@
 arams);%0A
+    cordova.fireWindowEvent(%22microphonelevels%22, info);%0A
 %7D%0A%0Avar o
@@ -795,16 +795,64 @@
 r);%0A%7D;%0A%0A
+var microphoneLevels = new MicrophoneLevels();%0A%0A
 module.e
@@ -856,29 +856,25 @@
 e.exports = 
-new M
+m
 icrophoneLev
@@ -864,23 +864,21 @@
 s = microphoneLevels
-()
 ;

create window event