emj365 / cordova-plugin-audio-recorder-api Goto Github PK
View Code? Open in Web Editor NEWThis plugin is a Cordova audio recorder plugin which works as API.
This plugin is a Cordova audio recorder plugin which works as API.
I have run this in Android 4.4.2. It records, it plays back and it shows file location but the file is not saved there. Maybe it gets deleted somehow.
/data/data/app-id/files/file-id.m4a
Hello,
First of all thanks for your great work. I am using your plugin for developing one of my ionic 2 project. Recording was successful in IOS but volume is very low. I ain't facing such problem with android but with IOS only. I tried to play the audio with cordova media plugin, mediaElement JS player & HTML5 audio tag. Everywhere having same problem. Any suggestion?
Thanks
Jibon
Hi, I used the following function on both Android and iOS but it returned error. Does anyone know if any fork works?
recorder.record = function() {
window.plugins.audioRecorderAPI.record(function(msg) {
// complete
alert('ok: ' + msg);
}, function(msg) {
// failed
alert('ko: ' + msg);
}, 30); // record 30 seconds
}
I want to record something of 30 seconds. In my ionic controller I call the RecordService where your API is used to record, everything works, but I want to return something to my controller once the success function is done... How can I do that?
SERVICE:
.service('RecordService', function (UsersModel, Backand, $cordovaMedia, $q, $cordovaFile, $state) {
var service = this;
service.record = function () {
return window.plugins.audioRecorderAPI.record(function (savedFilePath) {
var fileName = savedFilePath.split('/')[savedFilePath.split('/').length - 1];
// Store filename in user object in database
Backand.getUserDetails().then(function (result) {
UsersModel.fetch(result.userId).then(function (user) {
user.data.music = fileName;
UsersModel.update(result.userId, user.data).then(function (updatedUser) {
console.log(updatedUser);
return savedFilePath;
})
}, function (error) {
console.log(error);
})
}, function (error) {
console.log(error);
});
}, function (error) {
console.log("Kapot: " + msg);
return error;
}, 30);
}
})
CONTROLLER:
function record() {
rec.recording = true;
startTimer();
RecordService.record() // Here do something like .then(function() {bla bla}) ?;
}
Hi. Is there any way I can get the contents of the recorded file back in javascript, so I can send that blob to my server?
Thanks.
Is there a way to pause or stop the playback after recording it?
In the iOS, invoke the callback delays when recording complete with duration.
But the manually stopping is fine.
So I guess using the timer to control it in iOS should solve the problem.
Once starting record will get:
Jul 11 12:54:41 M-MB-A.local test_ionic[98207]: 12:54:41.507 ERROR: >aq> 4336: aq@0x7a3c5a00: AudioConverterFillComplexBuffer returned 560226676, packetCount 21
Same problem here:
http://stackoverflow.com/questions/12439333/error-recording-audio-in-iphone-simulator
I couldn't fix it.
After few seconds of audio recording start function call it failed with the following error message:
setAudioSource failed
This issue I found in marshmallow device. Also can you add support for pause audio recording if possible.
This plugin produces a strange bug on my iPhone. Recording a sound will forcibly swap my Cordova app's html5 audio output to headphones instead of speakers. Only creating a new Media, or calling the playback, after recording will the app return to the correct audio output. This is not the behavior on an iPad. Perhaps see:
http://stackoverflow.com/questions/1022992/how-to-get-avaudioplayer-output-to-the-speaker/24254408
I clicked the record,but it alert invalid action in android.Why?
There is not an event related to timeout, so when I stop a recording already stopped by timeout I don't know recording status and I get an exception (the application dies), I get this behaviour on android platform, I don't know if there is the same problem on iOS. Do you think to fix it? Thanks
I'm getting prepareToRecord failed on ios 9.3.
The file path where it is trying to be saved is: var/mobile/Containers/Data/Application/C9BC7E3A-6030-4251-BBE7-AC19A74E762A/Library/NoCloud/76DB73CC-9F88-4304-8021-4D71C71A597B.m4a
Hi,
The audio file created in Android is under /data/data, I need to use $cordovaFileTransfer to upload the audio file to Amazon S3, but look like no access right to this file, even tried to copy it to another location, same error.
Can you generate the audio file under different location.
Thanks
If there any way that able to get the total duration of recorded voice?
Hi:
I found this plugin works well on ios simulator, but seem not works on device, and every recording file only 1s?
This plugin does not work on Android 6.0.Can you fix it ?
Im using touchstart and touchend events to fire / stop recording but when the file is too long it just crashes my app. My device has resources so I dont think is cache?
thanks!
thank you for this plugin, it's the only one I managed to work with Ionic :)
is there any way to setup volume of recording/playback?
Does duration necessary?
We are using geolocation in the background. (Using plugin from https://github.com/mauron85/cordova-plugin-background-geolocation) With that, we get a message in the notification area that the app is in the background and using location services.
If while in the app, if we do a recording and then stop the recording, in some phones we get a microphone icon in addition to the location icon when notifying us about the app in the background.
Our UI for recording sound involves holding a button down whilst recording, then releasing to stop. We call the plugin on touchstart, then again on touchend.
This appears to work on every phone/OS that we tested apart from Android 4.4.2 on the Galaxy Note II. In this case, calling the plugin to start recording causes the touchend event to fire in the webview. In practice, this makes it appear as though the user has taken their finger off the screen.
Specifically, this line seems to be causing this behaviour:
myRecorder = new MediaRecorder();
...
myRecorder.prepare();
myRecorder.start(); // <--- THIS CAUSES TOUCHEND EVENT
Any ideas how to prevent or workaround this issue? Thanks in advance.
I was wondering if something is being done differently in regards to the bitrate for this plugin. For voice memos on the iphone, the quality is crisp. For this plugin, the audio quality sounds cloudy.
App would crash when stop record and then start
The situation is the same as http://stackoverflow.com/questions/7522768/mediarecorder-crashes-when-record-a-second-audio-clip
Thanks.
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.