Skip to content

Commit

Permalink
Change file extensions from .es6 to .js
Browse files Browse the repository at this point in the history
  • Loading branch information
ozaner committed Oct 20, 2024
1 parent 83a387b commit eba125c
Show file tree
Hide file tree
Showing 29 changed files with 50 additions and 51 deletions.
3 changes: 1 addition & 2 deletions esbuild.config.cjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
const esbuild = require('esbuild');

esbuild.build({
entryPoints: ['src/index.es6'],
entryPoints: ['src/index.js'],
bundle: true,
format: 'esm', // Output as ES module
platform: 'node', // Output for Node.js
outfile: 'bundle.js', // Output bundle
loader: { '.es6': 'js' }, // Treat .es6 files as JS
})
.then(() => {
console.log('Build succeeded');
Expand Down
8 changes: 4 additions & 4 deletions src/index.es6 → src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {TextToPhonemes} from './reciter/reciter.es6';
import {TextToPhonemesCMU} from './reciter/cmu-reciter.es6';
import {SamProcess, SamBuffer} from './sam.es6';
import { ToWavBuffer } from './util.es6';
import {TextToPhonemes} from './reciter/reciter.js';
import {TextToPhonemesCMU} from './reciter/cmu-reciter.js';
import {SamProcess, SamBuffer} from './sam.js';
import { ToWavBuffer } from './util.js';

/**
* @param {string} text
Expand Down
10 changes: 5 additions & 5 deletions src/parser/adjust-lengths.es6 → src/parser/adjust-lengths.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
PhonemeNameTable,
phonemeFlags,
} from './tables.es6';
} from './tables.js';

import {
FLAG_PUNCT,
Expand All @@ -13,12 +13,12 @@ import {
FLAG_VOICED,
FLAG_CONSONANT,
FLAG_VOWEL
} from './constants.es6'
} from './constants.js'

import './typehints.es6';
import './typehints.js';

import { phonemeHasFlag } from "./util.es6";
import { matchesBitmask } from "../util.es6";
import { phonemeHasFlag } from "./util.js";
import { matchesBitmask } from "../util.js";

/**
* Applies various rules that adjust the lengths of phonemes
Expand Down
6 changes: 3 additions & 3 deletions src/parser/c-conv/parser.es6 → src/parser/c-conv/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
flags,
phonemeLengthTable,
phonemeStressedLengthTable
} from './tables.es6';
} from './tables.js';

import {
pR,
Expand All @@ -27,11 +27,11 @@ import {
FLAG_VOICED,
FLAG_STOPCONS,
FLAG_UNVOICED_STOPCONS,
} from '../constants.es6'
} from '../constants.js'

const END = 255;

import {text2Uint8Array} from '../../util.es6';
import {text2Uint8Array} from '../../util.js';

function full_match(sign1, sign2) {
let Y = 0;
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/parser/copy-stress.es6 → src/parser/copy-stress.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {FLAG_VOWEL, FLAG_CONSONANT} from './constants.es6'
import {FLAG_VOWEL, FLAG_CONSONANT} from './constants.js'

import { phonemeHasFlag } from './util.es6';
import { phonemeHasFlag } from './util.js';

/**
* Iterates through the phoneme buffer, copying the stress value from
Expand Down
2 changes: 1 addition & 1 deletion src/parser/parse1.es6 → src/parser/parse1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PhonemeNameTable, StressTable} from './tables.es6';
import {PhonemeNameTable, StressTable} from './tables.js';

/**
* Match two character phoneme.
Expand Down
6 changes: 3 additions & 3 deletions src/parser/parse2.es6 → src/parser/parse2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PhonemeNameTable } from './tables.es6';
import { phonemeHasFlag } from './util.es6';
import { PhonemeNameTable } from './tables.js';
import { phonemeHasFlag } from './util.js';
import {
pR,
pD,
Expand All @@ -9,7 +9,7 @@ import {
FLAG_DIPHTHONG,
FLAG_DIP_YX,
FLAG_VOWEL
} from './constants.es6'
} from './constants.js'

/**
* Rewrites the phonemes using the following rules:
Expand Down
14 changes: 7 additions & 7 deletions src/parser/parser.es6 → src/parser/parser.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {PhonemeNameTable} from './tables.es6';
import {Parser1} from './parse1.es6';
import {Parser2} from './parse2.es6';
import {AdjustLengths} from './adjust-lengths.es6';
import {CopyStress} from './copy-stress.es6';
import {SetPhonemeLength} from './set-phoneme-length.es6';
import {ProlongPlosiveStopConsonantsCode41240} from './prolong-plosive-stop-consonants.es6';
import {PhonemeNameTable} from './tables.js';
import {Parser1} from './parse1.js';
import {Parser2} from './parse2.js';
import {AdjustLengths} from './adjust-lengths.js';
import {CopyStress} from './copy-stress.js';
import {SetPhonemeLength} from './set-phoneme-length.js';
import {ProlongPlosiveStopConsonantsCode41240} from './prolong-plosive-stop-consonants.js';

/**
* Parses speech data.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {combinedPhonemeLengthTable} from './tables.es6';
import {FLAG_0008, FLAG_STOPCONS, FLAG_UNVOICED_STOPCONS} from './constants.es6'
import { phonemeHasFlag } from './util.es6';
import {combinedPhonemeLengthTable} from './tables.js';
import {FLAG_0008, FLAG_STOPCONS, FLAG_UNVOICED_STOPCONS} from './constants.js'
import { phonemeHasFlag } from './util.js';

/**
* Makes plosive stop consonants longer by inserting the next two following
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {combinedPhonemeLengthTable} from './tables.es6';
import {combinedPhonemeLengthTable} from './tables.js';

/**
* change phoneme length dependent on stress
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/parser/util.es6 → src/parser/util.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {phonemeFlags} from './tables.es6';
import {phonemeFlags} from './tables.js';

import { matchesBitmask } from '../util.es6';
import { matchesBitmask } from '../util.js';

/**
* Test if a phoneme has the given flag.
*
* @param {Number} phoneme The phoneme to test.
* @param {Number} flag The flag to test (see constants.es6)
* @param {Number} flag The flag to test (see constants.js)
*
* @return {boolean}
*/
Expand Down
2 changes: 1 addition & 1 deletion src/reciter/cmu-reciter.es6 → src/reciter/cmu-reciter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {TextToPhonemes} from './reciter.es6';
import {TextToPhonemes} from './reciter.js';
import {ToWords} from 'npm:[email protected]';
import cmudict from 'https://cdn.jsdelivr.net/gh/stdlib-js/datasets-cmudict@deno/mod.js';
const cmudict_val = cmudict();
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/reciter/reciter.es6 → src/reciter/reciter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tables from './tables.es6';
import * as tables from './tables.js';

import {
FLAG_NUMERIC,
Expand All @@ -9,7 +9,7 @@ import {
FLAG_CONSONANT,
FLAG_VOWEL_OR_Y,
FLAG_ALPHA_OR_QUOT
} from './constants.es6'
} from './constants.js'

/**
* Test if the char matches against the flags in the reciter table.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
ampldata,
sampledConsonantFlags,
stressPitch_tab47492,
} from './tables.es6';
import {PHONEME_PERIOD, PHONEME_QUESTION} from '../parser/constants.es6';
} from './tables.js';
import {PHONEME_PERIOD, PHONEME_QUESTION} from '../parser/constants.js';

const RISING_INFLECTION = 255;
const FALLING_INFLECTION = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {blendRank, inBlendLength, outBlendLength} from './tables.es6';
import {blendRank, inBlendLength, outBlendLength} from './tables.js';

/**
* CREATE TRANSITIONS.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {SetMouthThroat} from './set-mouth-throat.es6'
import {CreateTransitions} from './create-transitions.es6';
import {CreateFrames} from './create-frames.es6';
import {SetMouthThroat} from './set-mouth-throat.js'
import {CreateTransitions} from './create-transitions.js';
import {CreateFrames} from './create-frames.js';

export const PrepareFrames = (phonemes, pitch, mouth, throat, singmode) => {
const freqdata = SetMouthThroat(mouth, throat);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
sampledConsonantValues0,
sampleTable
} from './tables.es6';
} from './tables.js';

const RenderSample = (Output, lastSampleOffset, consonantFlag, pitch) => {

Expand Down
6 changes: 3 additions & 3 deletions src/renderer/renderer.es6 → src/renderer/renderer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {PrepareFrames} from './prepare-frames.es6';
import {CreateOutputBuffer} from './output-buffer.es6';
import {ProcessFrames} from './process-frames.es6';
import {PrepareFrames} from './prepare-frames.js';
import {CreateOutputBuffer} from './output-buffer.js';
import {ProcessFrames} from './process-frames.js';

/**
* @param {Array} phonemes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {frequencyData} from './tables.es6';
import {frequencyData} from './tables.js';

/**
* SAM's voice can be altered by changing the frequencies of the
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/sam.es6 → src/sam.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Uint8ArrayToFloat32Array} from './util.es6';
import {Uint8ArrayToFloat32Array} from './util.js';

import {Parser} from './parser/parser.es6';
import {Renderer} from './renderer/renderer.es6';
import {Parser} from './parser/parser.js';
import {Renderer} from './renderer/renderer.js';

/**
* Process the input and return the audio buffer.
Expand Down
File renamed without changes.

0 comments on commit eba125c

Please sign in to comment.