Skip to Content
Author's profile photo Daniel Van Leeuwen

Getting Started with Kapsel – SAP Fiori Client Plugins — Voice Recording


Voice Recording Plugin (SP10+)

The Cordova Media Capture plugin provides the ability to capture Audio, Image and Video.  The Kapsel Voice Recording plugin provides the ability to record audio in an encrypted format and provides a SAPUI5 user interface to record and play back the audio.

Note that the API exposed by this plugin changed in SP10.  If you are using SP09 or SP08, see Voice Recording Plugin (New in SP08).

For additional details see C:\SAP\MobileSDK3\KapselSDK\docs\api\sap.VoiceRecording.html or the Documentation at Using the Voice Recording Plugin.

The following steps will demonstrate this plugin.

  • Create the project and add the voice recording plugin.
    cordova create C:\Kapsel_Projects\VoiceRecordingDemo com.mycompany.voicerecording VoiceRecordingDemo
    cd C:\Kapsel_Projects\VoiceRecordingDemo
    cordova platform add android
    cordova plugin add kapsel-plugin-voicerecording --searchpath %KAPSEL_HOME%/plugins
    cordova create ~/Documents/Kapsel_Projects/VoiceRecordingDemo com.mycompany.voicerecording VoiceRecordingDemo
    cd ~/Documents/Kapsel_Projects/VoiceRecordingDemo
    cordova platform add ios
    cordova plugin add kapsel-plugin-voicerecording --searchpath $KAPSEL_HOME/plugins
  • Replace www\index.html with the contents of index.html.
  • Prepare, build and deploy the app with the following commands.
    cordova run android
    cordova run ios

    Note, the Android emulator or iOS simulator can be used for this sample.


    The last image was taken against an Android emulator where the file system can be viewed.  Notice above that the file is encrypted.  When playing it or after calling recording.getAsFile a copy of the unencrypted file is temporarily available.

  • Note that in SP10 PL04 and perhaps earlier PLs you may need to add the following line of code to prevent an error store not defined.
    //around line 722 in recording.js
    if (state.secureStoreOpen) {
        store = utils.getEncryptedStorage(); //add this line to prevent Can't find variable store errors after calling the recording.getAsFile method.

    On 7 inch Android devices or emulators, you may wish to tweak the code to prevent the orientation from changing when displaying the recording or playback screen.  This may be fixed already in a more recent SAPUI5 release.

    //around line 230 in screen.js
    beforeOpen: function() {
        //if ( screen.lockOrientation("portrait");
        if ((window.screen.height < 600) || (window.screen.width < 600)) screen.lockOrientation("portrait");

Back to Getting Started With Kapsel

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Daniel Van Leeuwen
      Daniel Van Leeuwen
      Blog Post Author

      Updated for SMP 3.0 SDK SP10.