Customizing the UI for Audio Capture

2 posts, 0 answers
  1. Jason
    Jason avatar
    3 posts
    Member since:
    Mar 2015

    Posted 28 May 2015 Link to this post

    We're building an app that captures audio/video as part of a training exercise. We want to customize the UI used to capture the audio (orientation, etc.), but we can't find any information on doing so. Can anyone point us in the right direction?
  2. Tsvetina
    Admin
    Tsvetina avatar
    1874 posts

    Posted 02 Jun 2015 Link to this post

    Hello Jason,

    You can use the Media core plugin to record audio. Use its ​startRecord​ and ​stopRecord​ methods to make a recording. You can tie them to any UI you create for your application. Here is a small sample of how you can trigger and stop a recording using the plugin:

    var src = "myrecording.wav";
    var mediaRec = new Media(src,
        // success callback
        function () {
            console.log("recordAudio():Audio Success");
        },
     
        // error callback
        function (err) {
            console.log("recordAudio():Audio Error: " + err.code);
        }
    );
     
    // Record audio
    mediaRec.startRecord();
     
    // Stop recording after 2 seconds
    setTimeout(function () {
        mediaRec.stopRecord();
    }, 2000);



    Regards,
    Tsvetina
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top