Ionic audio capture

Asked

Viewed 181 times

2

I made an app that captures audio by the native recorder of the phone, now I needed to take these media, how can I get this media from the phone?

I did the following controller to capture

.controller('CapturaAudio', function ($scope, $cordovaCapture) {

    $scope.captureAudio = function () {
        var options = {
            limit: 3,
            duration: 10
        };

        $cordovaCapture.captureAudio(options).then(function (audioData) {
            // Success! Audio data is here
        }, function (err) {
            // An error occurred. Show a message to the user
        });
    }

1 answer

0

You could do something like this:

 $cordovaCapture.captureAudio(options).then(function (audioData) {
            // Success! Audio data is here
            console.log('captureSuccess');console.dir(e);
            $scope.sound.file = e[0].localURL;
            $scope.sound.filePath = e[0].fullPath;
        }, function (err) {
            // An error occurred. Show a message to the user
        });

Browser other questions tagged

You are not signed in. Login or sign up in order to post.