FantasyTalking FAQ

Installation Issues

What to do if installation fails?

Various issues may occur during installation. First, confirm that the environment meets the requirements. Check if Node.js version is 14.0 or higher using node --version. If using Python version, ensure Python version is 3.7 or higher.

If installation still fails, try the following: Clear npm cache with npm cache clean --force; Use domestic mirror with npm config set registry https://registry.npmmirror.com; Or install from source.

FFmpeg Installation Issues

On some systems, FFmpeg may not be properly installed or configured. You can download pre-compiled binaries from the FFmpeg official website, or install using package managers: Use brew install ffmpeg on macOS, apt-get install ffmpeg or yum install ffmpeg on Linux, or download from the official website or use Chocolatey on Windows.

Usage Issues

What to do if speech synthesis is slow?

Speech synthesis speed depends on multiple factors. First check network connection—if using cloud services, network latency affects response time. Consider self-hosting services to reduce network overhead. For large batch synthesis tasks, use the batch synthesis interface which can significantly improve efficiency. You can also adjust audio parameters—reducing sample rate can speed up synthesis.

How to choose the right voice style?

FantasyTalking provides various voice styles including neutral, happy, sad, angry, excited. Choose based on application scenario: Use neutral or professional for customer service; Choose different styles for educational applications based on content; Use more expressive styles for entertainment applications. You can use A/B testing to find the most suitable style.

How to implement English speech synthesis?

Specify English as the language in the default configuration:

const audio = await client.speak('Hello, world!', {
  voice: {
    language: 'en-US',  // or en-GB
    style: 'neutral'
  }
});

Supported language codes include en-US, en-GB, en-AU, etc. Different language codes will use corresponding regional pronunciation models.

SSML markup not working?

Ensure you pass the ssml: true parameter when calling the speak function. Check if SSML markup is correct—tag names should be lowercase. Some special characters need XML escaping—for example, less than signs need to be changed to <. If problems persist, some SSML features may not be supported in the current language.

Dialogue Features

Dialogue context not coherent?

Ensure you are using the same session instance—each call to session.chat() automatically includes previous dialogue history. If you need a new conversation, create a new session instance. Check if the context window limit is reached—the default is 5 turns. You can modify configuration to adjust context window size.

How to save and restore conversations?

Use session.getHistory() to get dialogue history—the returned JSON data can be saved to a file. To restore a conversation, use client.loadSession(history) method to load history. Note that loaded sessions will continue from the saved state.

Audio Issues

Noise in generated audio?

Noise issues are usually related to audio configuration or network transmission. Check if audio format and sample rate match the target playback device. Try using the noise reduction function client.process(audio, { denoise: true }). If it's a network transmission issue, consider using locally deployed services.

How to adjust speed and pitch?

Adjust related parameters in voice configuration:

const audio = await client.speak('Text', {
  voice: {
    speed: 1.5,  // 1.5x speed, range 0.5-2.0
    pitch: 0.8  // Lower pitch, range 0.5-2.0
  }
});

Note that excessive adjustment may affect speech naturalness.

Account and Billing

How to get API key?

Visit FantasyTalking official website to register an account, then create an API key in the console. New users usually receive some free credits for testing. API keys should be kept secure—do not hardcode in client code, use environment variables instead.

How to view usage?

After logging into the console, you can view API call count and usage quota on the dashboard. You can also query using the SDK method:

const usage = await client.getUsage();
console.log(`Calls this month: ${usage.count}`);
console.log(`Free credits remaining: ${usage.remaining}`);
console.log(`Current billing period: ${usage.period}`);

Deployment Issues

Docker deployment failed?

First confirm Docker is properly installed and running. Check if port 8080 is in use—you can change the mapping port. If using cloud services, ensure security groups have opened the corresponding ports. Check container logs docker logs fantasy-talking for detailed error information.

How to achieve high-availability deployment?

For production environments, it is recommended to use load balancers with multiple FantasyTalking instances. Session data needs external storage (like Redis) for multi-instance sharing. You can use Docker Swarm or Kubernetes for container orchestration to achieve auto-scaling and fault recovery.

Development and Debugging

How to enable debug mode?

Set debug option when initializing client:

const client = new FantasyTalking({
  apiKey: 'your-api-key',
  debug: true  // Enable debug mode
});

Debug mode outputs detailed request and response information for troubleshooting.

How to get detailed error information?

All SDK methods throw error objects with detailed information on failure:

try {
  await client.speak('text');
} catch (error) {
  console.log('Error code:', error.code);
  console.log('Error message:', error.message);
  console.log('HTTP status:', error.status);
  console.log('Request ID:', error.requestId);  // For support feedback
}

Other Issues

Which platforms does FantasyTalking support?

FantasyTalking supports major platforms and frameworks: Web supports all modern browsers, mobile supports iOS and Android, desktop supports Windows, macOS and Linux, server supports Node.js and Python.

How to contribute to the project?

Contributions to FantasyTalking are welcome! You can participate by: Submitting issues on GitHub to report problems or suggest features; Submitting Pull Requests to contribute code; Improving documentation and translations; Participating in community discussions. See CONTRIBUTING.md in the repository for detailed contribution guidelines.