{"version":3,"sources":["jsdelivr-header.js","/npm/react-native-android-audiorecorder@1.0.4/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,IAAI,OAAO,cAAC,cAAa,sBAAE,sBAAqB,mBAAE,oBAAuB,QAAQ,gBAEjF,MAAM,uBAAE,uBAAsB,qBAAE,sBAAyB,cAEzD,IAAI,YAAc,CAChB,KAAM,SAAS,EAAM,GASnB,OARI,GACI,oBAAqB,IACzB,EAAyB,gBAAI,eACzB,kBAAmB,IACvB,EAAuB,cAAI,IAE7B,EAAU,CAAC,gBAAiB,cAAe,cAAe,GAErD,qBAAqB,KAAK,EAAM,EACzC,EACA,YAAa,SAAS,EAAK,GASzB,OARI,GACI,oBAAqB,IACzB,EAAyB,gBAAI,eACzB,kBAAmB,IACvB,EAAuB,cAAI,IAE7B,EAAU,CAAC,gBAAiB,cAAe,cAAe,GAErD,qBAAqB,YAAY,EAAK,EAC/C,EACA,MAAO,WACL,OAAO,qBAAqB,OAC9B,EACA,QAAS,WACP,OAAO,qBAAqB,SAC9B,EACA,KAAM,WACJ,OAAO,qBAAqB,MAC9B,EACA,eAAgB,SAAS,GACvB,OAAO,qBAAqB,eAAe,EAC7C,EACA,cAAe,SAAS,GACtB,OAAO,qBAAqB,cAAc,EAC5C,EACA,wBAAyB,WACnB,KAAK,sBAAsB,KAAK,qBAAqB,SACzD,KAAK,qBAAuB,mBAAmB,YAAY,kBACxD,IACK,KAAK,YACP,KAAK,WAAW,EAClB,GAGN,EACA,wBAAyB,WACnB,KAAK,sBAAsB,KAAK,qBAAqB,SACzD,KAAK,qBAAuB,mBAAmB,YAAY,kBACxD,IACK,KAAK,YACP,KAAK,WAAW,EAClB,GAGN,EACA,oBAAqB,SAAS,GAC5B,OAAO,qBAAqB,oBAAoB,EAClD,EAEA,YAAa,SAAS,GACpB,qBAAqB,aAAY,CAAC,EAAO,KACvC,EAAS,EAAS,GAEtB,EAEA,eAAgB,SAAS,GACvB,qBAAqB,gBAAe,CAAC,EAAO,KAC1C,EAAS,EAAY,GAEzB,GAEE,cAAgB,CAClB,uBAAwB,SAAS,EAAM,GACrC,IASI,EAAmB,CARrB,WAAY,MACZ,SAAU,EACV,aAAc,OACd,cAAe,OACf,aAAc,SACd,iBAAiB,EACjB,qBAAsB,QAEsB,GAC9C,uBAAuB,uBAAwB,EAAM,GAChD,KAAK,sBAAuB,KAAK,qBAAqB,SAC3D,KAAK,qBAAuB,sBAAsB,YAAY,WAC3D,IACK,KAAK,SACP,KAAK,QAAQ,EACf,IAIA,KAAK,sBAAsB,KAAK,qBAAqB,SACzD,KAAK,qBAAuB,sBAAsB,YAAY,YAC3D,IACK,KAAK,UACP,KAAK,SAAS,EAChB,GAGN,EACA,eAAgB,WACd,OAAO,uBAAuB,gBAChC,EACA,cAAe,WACb,OAAO,uBAAuB,eAChC,EACA,YAAa,WACX,OAAO,uBAAuB,aAChC,EACA,aAAc,WACZ,OAAO,uBAAuB,cAChC,EACA,cAAe,WACb,OAAO,uBAAuB,eAChC,EACA,yBAA0B,uBAAuB,yBACjD,qBAAsB,uBAAuB,sBAG/C,IAAI,WAAa,CACf,eAAgB,uBAAuB,eACvC,oBAAqB,uBAAuB,oBAC5C,sBAAuB,uBAAuB,sBAC9C,qBAAsB,uBAAuB,qBAC7C,sBAAuB,uBAAuB,sBAC9C,mBAAoB,uBAAuB,mBAC3C,uBAAwB,uBAAuB,wBAGjD,OAAO,QAAU,CAAE,4BAAc,wBAAa","file":"/npm/react-native-android-audiorecorder@1.0.4/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-native-android-audiorecorder@1.0.4/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var React, {NativeModules, NativeAppEventEmitter, DeviceEventEmitter } = require('react-native');\n\nconst { RNAndroidAudiorecorder, RNAndroidAudioplayer } = NativeModules;\n\nvar AudioPlayer = {\n  play: function(path, options) {\n    if (options) {\n      if (!('sessionCategory' in options))\n        options['sessionCategory'] = 'SoloAmbient';\n      if (!('numberOfLoops' in options))\n        options['numberOfLoops'] = 0;\n    } else {\n      options = {sessionCategory: 'SoloAmbient', numberOfLoops: 0}\n    }\n    return RNAndroidAudioplayer.play(path, options);\n  },\n  playWithUrl: function(url, options) {\n    if (options) {\n      if (!('sessionCategory' in options))\n        options['sessionCategory'] = 'SoloAmbient';\n      if (!('numberOfLoops' in options))\n        options['numberOfLoops'] = 0;\n    } else {\n      options = {sessionCategory: 'SoloAmbient', numberOfLoops: 0}\n    }\n    return RNAndroidAudioplayer.playWithUrl(url, options);\n  },\n  pause: function() {\n    return RNAndroidAudioplayer.pause();\n  },\n  unpause: function() {\n    return RNAndroidAudioplayer.unpause();\n  },\n  stop: function() {\n    return RNAndroidAudioplayer.stop();\n  },\n  setCurrentTime: function(time) {\n    return RNAndroidAudioplayer.setCurrentTime(time);\n  },\n  skipToSeconds: function(position) {\n    return RNAndroidAudioplayer.skipToSeconds(position);\n  },\n  setProgressSubscription: function() {\n    if (this.progressSubscription) this.progressSubscription.remove();\n    this.progressSubscription = DeviceEventEmitter.addListener('playerProgress',\n      (data) => {\n        if (this.onProgress) {\n          this.onProgress(data);\n        }\n      }\n    );\n  },\n  setFinishedSubscription: function() {\n    if (this.finishedSubscription) this.finishedSubscription.remove();\n    this.finishedSubscription = DeviceEventEmitter.addListener('playerFinished',\n      (data) => {\n        if (this.onFinished) {\n          this.onFinished(data);\n        }\n      }\n    );\n  },\n  getDurationFromPath: function(path){\n    return RNAndroidAudioplayer.getDurationFromPath(path);\n  },\n\n  getDuration: function(callback) {\n    RNAndroidAudioplayer.getDuration((error, duration) => {\n      callback(duration);\n    })\n  },\n\n  getCurrentTime: function(callback) {\n    RNAndroidAudioplayer.getCurrentTime((error, currentTime) => {\n      callback(currentTime);\n    })\n  },\n};\nvar AudioRecorder = {\n  prepareRecordingAtPath: function(path, options) {\n    var defaultOptions = {\n      SampleRate: 44100.0,\n      Channels: 2,\n      AudioQuality: 'High',\n      AudioEncoding: 'ima4',\n      OutputFormat: 'mpeg_4',\n      MeteringEnabled: false,\n      AudioEncodingBitRate: 32000\n    };\n    var recordingOptions = {...defaultOptions, ...options};\n    RNAndroidAudiorecorder.prepareRecordingAtPath( path, recordingOptions );\n    if ( this.progressSubscription ) this.progressSubscription.remove();\n    this.progressSubscription = NativeAppEventEmitter.addListener('onStart',\n      (data) => {\n        if (this.onStart) {\n          this.onStart(data);\n        }\n      }\n    );\n\n    if (this.finishedSubscription) this.finishedSubscription.remove();\n    this.finishedSubscription = NativeAppEventEmitter.addListener('onFinish',\n      (data) => {\n        if (this.onFinish) {\n          this.onFinish(data);\n        }\n      }\n    );\n  },\n  startRecording: function() {\n    return RNAndroidAudiorecorder.startRecording();\n  },\n  playRecording: function() {\n    return RNAndroidAudiorecorder.playRecording();\n  },\n  stopPlaying: function() {\n    return RNAndroidAudiorecorder.stopPlaying();\n  },\n  pausePlaying: function() {\n    return RNAndroidAudiorecorder.pausePlaying();\n  },\n  stopRecording: function() {\n    return RNAndroidAudiorecorder.stopRecording();\n  },\n  checkAuthorizationStatus: RNAndroidAudiorecorder.checkAuthorizationStatus,\n  requestAuthorization: RNAndroidAudiorecorder.requestAuthorization,\n};\n\nlet AudioUtils = {\n  MainBundlePath: RNAndroidAudiorecorder.MainBundlePath,\n  CachesDirectoryPath: RNAndroidAudiorecorder.CachesDirectoryPath,\n  DocumentDirectoryPath: RNAndroidAudiorecorder.DocumentDirectoryPath,\n  LibraryDirectoryPath: RNAndroidAudiorecorder.LibraryDirectoryPath,\n  PicturesDirectoryPath: RNAndroidAudiorecorder.PicturesDirectoryPath,\n  MusicDirectoryPath: RNAndroidAudiorecorder.MusicDirectoryPath,\n  DownloadsDirectoryPath: RNAndroidAudiorecorder.DownloadsDirectoryPath\n};\n\nmodule.exports = { AudioRecorder,AudioPlayer, AudioUtils };\n"]}