funquail/front/tests/unit/specs/audio/volume.spec.js
JuniorJPDJ ffc9109a45 Change volume dynamic range from 60dB to 40dB
also makes it easily configurable in future if needed
changes volume calculation algo to more precise and easy to understand (dB definition)
2021-08-04 11:44:46 +00:00

25 lines
792 B
JavaScript

import { expect } from 'chai'
import { toLinearVolumeScale, toLogarithmicVolumeScale } from '@/audio/volume'
describe('store/auth', () => {
describe('toLinearVolumeScale', () => {
describe('it should return real 0', () => {
expect(toLinearVolumeScale(0.0)).to.equal(0.0)
})
describe('it should return full volume', () => {
expect(toLogarithmicVolumeScale(1.0)).to.be.closeTo(1.0, 0.001)
})
})
describe('toLogarithmicVolumeScale', () => {
describe('it should return real 0', () => {
expect(toLogarithmicVolumeScale(0.0)).to.equal(0.0)
})
describe('it should return full volume', () => {
expect(toLogarithmicVolumeScale(1.0)).to.be.closeTo(1.0, 0.001)
})
})
})