<commit_before>// service to handle recording and saving of data

'use strict';

angular.module('daApp')
  .factory('recordingService', recordingService);

recordingService.$inject = ['$http', 
                            '$localForage',
                            'tokenService'];

function recordingService($http, $localForage, tokenService) {
  var recHandler = {};

  recHandler.init = init;
  recHandler.record = record;
  recHandler.send = send;
  recHandler.stop = stop;


  var invalidTitle = 'no_data.wav';
  // for some reason, putting this in an array, makes angular updates this correctly
  recHandler.currentRecording = [{  "blob":new Blob(),
                                    "url":'',
                                    "title":invalidTitle}];

  // local variable definitions for service
  var start_time;
  var end_time;

  var audio_context;
  var recorder;

  return recHandler;

  //////////

  function init(updateBindingsCallback, recordingCompleteCallback) {
    recHandler.updateBindingsCallback = updateBindingsCallback;<commit_msg>Remove token service from recording service (not used).<commit_after>// service to handle recording and saving of data

'use strict';

angular.module('daApp')
  .factory('recordingService', recordingService);

recordingService.$inject = ['$http', 
                            '$localForage'];

function recordingService($http, $localForage) {
  var recHandler = {};

  recHandler.init = init;
  recHandler.record = record;
  recHandler.send = send;
  recHandler.stop = stop;


  var invalidTitle = 'no_data.wav';
  // for some reason, putting this in an array, makes angular updates this correctly
  recHandler.currentRecording = [{  "blob":new Blob(),
                                    "url":'',
                                    "title":invalidTitle}];

  // local variable definitions for service
  var start_time;
  var end_time;

  var audio_context;
  var recorder;

  return recHandler;

  //////////

  function init(updateBindingsCallback, recordingCompleteCallback) {
    recHandler.updateBindingsCallback = updateBindingsCallback;
{'fraction_non_alphanumeric': 0.10778727445394112, 'fraction_numerical': 0.0, 'mean_word_length': 2.7160493827160495, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5205989', 'n_tokens_mistral': 568, 'n_tokens_neox': 542, 'n_words': 150}