Closed Arpapiemonte closed 1 year ago
Capacitator support would be a very welcome addition. I haven't much time to maintain this plugin myself nowadays, but it is an open-source project, so any one who wants to contribute to it are welcome to file a PR.
Hi @edimuj , sorry if I didin't reply, but I haven't time and knowledge to help you in this work. I hope someone could help. Thanks
No problem at all!
fyi for future reference for people finding this issue, had no problems with a capacitor and react project. Just install package and npx cap sync
. And setup for typescript like explained in the readme of the repo. I dont know about vue but should also be fine. (the fact the poster seems to say it worked for them on angular with capacitor also does seem to point that something was just done wrong on their end in the vue template)
Make sure to put the permission check inside of a useEffect
call to make sure the components are actually all loaded right and thats about it.
The "webaudio live output" does not seem to work right though on android (just crackles) but thats another issue that doesnt concern this and is already brought up in other already opened issues. I ended up just having to use an encoder to just check that the raw pcm data we capture was actually good and it was.
[...]
const startCapture = async () => {
audioinput.start(audioCfg );
};
useEffect(() => {
// Check if we already have permission to record
audioinput.checkMicrophonePermission(function (hasPermission: boolean) {
if (hasPermission) {
console.log("We already have permission to record.");
} else {
// Ask the user for permission to access the microphone
audioinput.getMicrophonePermission(function (
hasPermission: boolean,
message: string
) {
if (hasPermission) {
console.log("User granted us permission to record.");
} else {
console.warn("User denied permission to record.");
}
});
}
});
}, []);
[...]
nb: if you dont actually need to specifically have the raw audio stream pcm data as chunks "in real time" i would recommend other plugins with easier interfaces but i need this and im happy for now :)
Thank you @jukefr !
Hi, I'm trying to use this plugin with a ionic-capacitor app I can install the plugin with (https://capacitorjs.com/docs/plugins/cordova):
With an
angular
app I manage to use the cordova-plugin. With avue
app I can't.Is scheduled a development of a capacitor version? Is this plugin mantained?
Thanks