Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

绑定到外部库

模块

The Summator example in 自定义 C++ 模块 is great for small, custom modules, but what if you want to use a larger, external library? Let's look at an example using Festival, a speech synthesis (text-to-speech) library written in C++.

要绑定到外部库, 请设置类似于Summator示例的模块目录:

godot/modules/tts/

Next, you will create a header file with a TTS class:

/* tts.h */

#ifndef GODOT_TTS_H
#define GODOT_TTS_H

#include "core/object/ref_counted.h"

class TTS : public RefCounted {