<commit_before>/**
 * @fileOverview
 * Audio buffer loader.
 * @author <NAME>, <NAME>, <NAME>, <NAME>
 * @version 4.0.0
 */

'use strict';

// Ensure global availability of an "audioContext" instance of web audio AudioContext.
window.audioContext = window.audioContext || new AudioContext() || new webkitAudioContext();

class BufferLoader {

  constructor() {
    this.progressCb = undefined;
  }

  /**
   * Main wrapper function for audio buffer loading.
   * Switch between loadBuffer and loadAll.
   * @public
   * @param fileURLs The URL(s) of the audio files to load. Accepts a URL to the audio file location or an array of URLs.
   */
  load(fileURLs) {
    if (Array.isArray(fileURLs)) {
      return this.loadAll(fileURLs);
    } else {
      return this.loadBuffer(fileURLs);
    }
  }

  /**
   * Load a single audio file,
   * decode it in an AudioBuffer, return a Promise<commit_msg>global audio context comes now from a module<commit_after>/**
 * @fileOverview
 * Audio buffer loader.
 * @author <NAME>, <NAME>, <NAME>, <NAME>
 * @version 4.0.0
 */

'use strict';

//make an AudioContext instance globally availbe
require("../audio-context");

class BufferLoader {

  constructor() {
    this.progressCb = undefined;
  }

  /**
   * Main wrapper function for audio buffer loading.
   * Switch between loadBuffer and loadAll.
   * @public
   * @param fileURLs The URL(s) of the audio files to load. Accepts a URL to the audio file location or an array of URLs.
   */
  load(fileURLs) {
    if (Array.isArray(fileURLs)) {
      return this.loadAll(fileURLs);
    } else {
      return this.loadBuffer(fileURLs);
    }
  }

  /**
   * Load a single audio file,
   * decode it in an AudioBuffer, return a Promise
{'fraction_non_alphanumeric': 0.11491584445734185, 'fraction_numerical': 0.003482298316889147, 'mean_word_length': 3.0950118764845604, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1245762', 'n_tokens_mistral': 536, 'n_tokens_neox': 524, 'n_words': 182}