This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const playlistFolder = path.resolve("./playlist"); | |
| const playlistTracks = [ | |
| "track1.mp3", | |
| "track2.mp3", | |
| "track3.mp3", | |
| ].map(folder => path.join(playlistFolder, folder)); | |
| let radioStream = new PassThrough(); | |
| let currentIndex = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "codigo": "0101", | |
| "descricao": "Análise e desenvolvimento de sistemas." | |
| }, | |
| { | |
| "codigo": "0102", | |
| "descricao": "Programação." | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import path from "path"; | |
| import express from "express"; | |
| import { createServer as createViteServer } from "vite"; | |
| import { createServer } from "./index.js"; | |
| const app = createServer(); | |
| const staticPath = path.join(process.cwd(), "dist", "spa"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input | |
| id={id} | |
| name={name} | |
| type="text" | |
| value={value} | |
| disabled={disabled} | |
| required={required} | |
| readOnly={readOnly} | |
| placeholder={placeholder} | |
| onSelect={function (event) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require(Modules.Avatar); | |
| VoxEngine.addEventListener(AppEvents.Started, function () { | |
| const data = JSON.parse(VoxEngine.customData() || "{}"); | |
| const call = VoxEngine.callPSTN(data.leadPhone, data.userPhone); | |
| const language = VoiceList.Microsoft.Neural?.[data?.voice]; | |
| // Ligação conectada | |
| call.addEventListener(CallEvents.Connected, function (event) { | |
| Logger.write("call connected"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useEffect, useRef, useState } from "react"; | |
| // type | |
| export type AudioDeviceOption = { id: string; value: string; label: string }; | |
| const useAudioDevice = function () { | |
| const audioStreamRef = useRef<MediaStream | null>(null); | |
| const [audioInputOptions, setAudioInputOptions] = useState<AudioDeviceOption[]>([]); | |
| const [audioOutputOptions, setAudioOutputOptions] = useState<AudioDeviceOption[]>([]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sharp from "sharp"; | |
| import fileTyper, { FileTypeResult } from "file-type"; | |
| import { statSync, readFileSync, existsSync } from "fs"; | |
| // utils | |
| import Hash from "./Hash"; | |
| import Logger from "./Logger"; | |
| export type MetadataInfo = { | |
| size: number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { IncomingHttpHeaders } from "http"; | |
| // types | |
| import { RequestExtended } from "../types/Request"; | |
| import { TypeUserAgentBrowser, TypeUserAgentDevice, TypeUserAgentSystem } from "../types/Utils"; | |
| /** | |
| * Class for detecting information about the browser and device from the User-Agent header. | |
| * | |
| * @class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function countDeepDifferences(a: any, b: any): number { | |
| // Se tipos diferentes, ou valor primitivo diferente | |
| if (typeof a !== typeof b || a === null || b === null) { | |
| return a === b ? 0 : 1; | |
| } | |
| // Comparar arrays | |
| if (Array.isArray(a) && Array.isArray(b)) { | |
| const length = Math.max(a.length, b.length); | |
| let count = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Convert Audio Chunk to Audio PCM 16Bit 24kHz Mono | |
| * (Required audio/wav and 24kHz Mono) | |
| * | |
| * @param {Float32Array<ArrayBufferLike>} chunk | |
| * @returns {Int16Array<ArrayBuffer>} | |
| */ | |
| const chunkToPCM = function (chunk) { | |
| const minimalInt = 0x8000; | |
| const maximalInt = 0x7fff; |
NewerOlder