genshin-manager
Version:
<div align="center"> <p> <a href="https://www.npmjs.com/package/genshin-manager"><img src="https://img.shields.io/npm/v/genshin-manager.svg?maxAge=3600" alt="npm version" /></a> <a href="https://www.npmjs.com/package/genshin-manager"><img src="https:
87 lines (86 loc) • 2.03 kB
TypeScript
import fs from 'fs';
import { CVType } from '../../types';
import { ClientOption } from '../../types';
/**
* Class for compiling information about audio
*/
export declare class AudioAssets {
/**
* Audio base URL of mihoyo
*/
private static readonly AUDIO_BASE_URL_MIHOYO;
/**
* Fetch option
*/
private static fetchOption;
/**
* Audio base URL by regex
*/
private static audioBaseURLByRegex;
/**
* Default audio base URL
*/
private static defaultAudioBaseURL;
/**
* Whether to cache the audio
*/
private static autoCacheAudio;
/**
* Audio folder path
*/
private static audioFolderPath;
/**
* Audio name
*/
readonly name: string;
/**
* Audio base URL
*/
readonly audioBaseURL: string;
/**
* Audio URL
*/
readonly url: string;
/**
* Audio cv
*/
readonly cv?: CVType;
/**
* Character ID
*/
readonly characterId?: number;
/**
* Audio URL of mihoyo
*/
readonly mihoyoURL: string;
/**
* Classes for handling audios
* @param name Audio name
* @param cv Audio cv
* @param characterId Character ID
*/
constructor(name: string, cv?: CVType, characterId?: number);
/**
* Classes for handling audios
* @param option Client option
*/
static deploy(option: ClientOption): void;
/**
* Fetch audio buffer
* @returns Audio buffer
*/
fetchBuffer(): Promise<Buffer>;
/**
* Fetch audio stream
* @param highWaterMark HighWaterMark
* @returns Audio stream
*/
fetchStream(highWaterMark?: number): Promise<fs.ReadStream>;
/**
* Check if the OGG file is corrupted
* @warning This function is not perfect, it may not be able to detect all corrupted OGG files. because it only checks the last OggS header.
* @param filePath File path
* @returns is OGG file corrupted
*/
private isOGGCorrupted;
}