@aituber-onair/voice
Version:
Voice synthesis library for AITuber OnAir
116 lines (115 loc) • 3.38 kB
TypeScript
import { Talk } from '../types/voice';
import { VoiceEngine } from './VoiceEngine';
/**
* Aivis Cloud API voice synthesis engine
*/
export declare class AivisCloudEngine implements VoiceEngine {
private modelUuid?;
private speakerUuid?;
private styleId?;
private styleName?;
private useSSML;
private speakingRate;
private emotionalIntensity;
private tempoDynamics;
private pitch;
private volume;
private leadingSilence;
private trailingSilence;
private lineBreakSilence;
private outputFormat;
private outputBitrate?;
private outputSamplingRate;
private outputChannels;
private enableBillingLogs;
/**
* Set model UUID
* @param modelUuid Aivis Cloud model UUID
*/
setModelUuid(modelUuid: string): void;
/**
* Set speaker UUID
* @param speakerUuid Aivis Cloud speaker UUID
*/
setSpeakerUuid(speakerUuid: string): void;
/**
* Set style ID
* @param styleId Style ID (0-31)
*/
setStyleId(styleId: number): void;
/**
* Set style name
* @param styleName Style name
*/
setStyleName(styleName: string): void;
/**
* Set SSML usage
* @param useSSML Enable SSML interpretation
*/
setUseSSML(useSSML: boolean): void;
/**
* Set speaking rate
* @param rate Speaking rate (0.5-2.0)
*/
setSpeakingRate(rate: number): void;
/**
* Set emotional intensity
* @param intensity Emotional intensity (0.0-2.0)
*/
setEmotionalIntensity(intensity: number): void;
/**
* Set tempo dynamics
* @param dynamics Tempo dynamics (0.0-2.0)
*/
setTempoDynamics(dynamics: number): void;
/**
* Set pitch
* @param pitch Pitch (-1.0-1.0)
*/
setPitch(pitch: number): void;
/**
* Set volume
* @param volume Volume (0.0-2.0)
*/
setVolume(volume: number): void;
/**
* Set silence durations
* @param leading Leading silence in seconds
* @param trailing Trailing silence in seconds
* @param lineBreak Line break silence in seconds
*/
setSilenceDurations(leading: number, trailing: number, lineBreak: number): void;
/**
* Set output format
* @param format Output format
*/
setOutputFormat(format: 'wav' | 'flac' | 'mp3' | 'aac' | 'opus'): void;
/**
* Set output bitrate
* @param bitrate Output bitrate in kbps (8-320)
*/
setOutputBitrate(bitrate: number): void;
/**
* Set output sampling rate
* @param rate Output sampling rate in Hz
*/
setOutputSamplingRate(rate: 8000 | 11025 | 12000 | 16000 | 22050 | 24000 | 44100 | 48000): void;
/**
* Set output channels
* @param channels Output channels (mono or stereo)
*/
setOutputChannels(channels: 'mono' | 'stereo'): void;
/**
* Enable or disable billing/usage information logs
* @param enable Whether to enable billing logs (default: false)
*/
setEnableBillingLogs(enable: boolean): void;
fetchAudio(input: Talk, speaker: string, apiKey?: string): Promise<ArrayBuffer>;
/**
* Get emotion settings based on emotion type
* @param emotion Emotion type
* @returns Emotion settings with adjusted emotional intensity
*/
private getEmotionSettings;
getTestMessage(textVoiceText?: string): string;
}