"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.bpmToPlaybackSpeed = void 0;

var _decimals = require("./decimals");

const baselineBPM = 60; // baseline bpm

const bpmToPlaybackSpeed = bpm => {
  const res = (0, _decimals.roundToDecimal)((bpm === null ? 60 : bpm) / baselineBPM, 3);
  return isNaN(res) ? 1 : res;
};

exports.bpmToPlaybackSpeed = bpmToPlaybackSpeed;