add initial marp implementation with sample content and build configuration
This commit is contained in:
24
node_modules/speech-rule-engine/mjs/audio/markup_renderer.js
generated
vendored
Normal file
24
node_modules/speech-rule-engine/mjs/audio/markup_renderer.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import * as EngineConst from '../common/engine_const.js';
|
||||
import { AbstractAudioRenderer } from './abstract_audio_renderer.js';
|
||||
export class MarkupRenderer extends AbstractAudioRenderer {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.ignoreElements = [EngineConst.personalityProps.LAYOUT];
|
||||
this.scaleFunction = null;
|
||||
}
|
||||
setScaleFunction(a, b, c, d, decimals = 0) {
|
||||
this.scaleFunction = (x) => {
|
||||
const delta = (x - a) / (b - a);
|
||||
const num = c * (1 - delta) + d * delta;
|
||||
return +(Math.round((num + 'e+' + decimals)) +
|
||||
'e-' +
|
||||
decimals);
|
||||
};
|
||||
}
|
||||
applyScaleFunction(value) {
|
||||
return this.scaleFunction ? this.scaleFunction(value) : value;
|
||||
}
|
||||
ignoreElement(key) {
|
||||
return this.ignoreElements.indexOf(key) !== -1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user