> For the complete documentation index, see [llms.txt](https://whitepaper.virtuals.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.virtuals.io/virtuals-protocol-whitepaper-ko/virtuals-1/the-protocol/ai-1/ai/ai-nft/ai-1.md).

# AI 에이전트를 위한 음성 코어

음성 인식, 음성 합성, VITS 음성 합성, 오디오 데이터 전처리를 포함한 AI 에이전트 음성을 위한 Virtuals Protocol 음성 코어를 살펴보세요.

Voice Core는 각 VIRTUAL 에이전트에 고유하고 개성에 맞는 목소리를 부여합니다. AI 음성 모델 학습은 각 에이전트와 역할에 대해 사실적이고 일관된 음성을 생성합니다.

### AI 에이전트 음성 모듈

**음성-텍스트(STT):** STT 모듈은 다양한 음성 데이터로 학습합니다. 사용자 시나리오 전반에 걸쳐 억양, 방언, 말하기 패턴을 정확하게 전사합니다.

**텍스트-음성(TTS):** TTS 모듈은 VITS(Variational Inference for Text-to-Speech) 학습을 사용합니다. VITS는 고품질의 자연스러운 음성을 생성하며, 각 AI 에이전트의 개성에 맞춘 음성 합성을 지원합니다.

음성 모델 학습 전에 오디오 데이터 전처리가 이루어집니다.

### 음성 모델을 위한 오디오 데이터 전처리

1. **오디오 형식 일관성:** 22050Hz의 모노 WAV 파일은 일관된 학습 입력을 생성합니다. 일관된 입력 데이터는 머신러닝 음성 모델이 안정적으로 동작하는 데 도움이 됩니다.
2. **샘플링 레이트 정규화:** 22050Hz 샘플링 레이트는 파일 크기를 적절하게 유지하면서 사람의 음성 주파수를 포착합니다. 나이퀴스트 정리에 따라 최대 11025Hz까지의 주파수를 포착합니다.
3. **모노 오디오 채널:** 스테레오 또는 다채널 오디오를 모노로 변환하면 음성 모델에 하나의 학습 채널을 제공하고 학습을 단순화합니다.

<details>

<summary>샘플 코드</summary>

```python
import os
from pydub import AudioSegment

upload_dir = 'upload_dir'
output_dir = 'out'

# 출력 디렉터리가 존재하는지 확인
os.makedirs(output_dir, exist_ok=True)

extensions = ['wav', 'mp3', 'ogg']

# 업로드 디렉터리의 모든 파일을 처리
for filename in os.listdir(upload_dir):
    if any(filename.lower().endswith(ext) for ext in extensions):
        # 파일 경로 구성
        file_path = os.path.join(upload_dir, filename)
        output_path = os.path.join(output_dir, os.path.splitext(filename)[0] + '.wav')

        # 오디오 파일 로드
        audio = AudioSegment.from_file(file_path)

        # WAV, 22050Hz, 모노로 변환
        audio = audio.set_frame_rate(22050).set_channels(1)

        # 처리된 오디오 내보내기
        audio.export(output_path, format='wav')

```

</details>

[<mark style="color:빨강;">Voice Core에 기여하는 방법에 대해 자세히 알아보세요.</mark>](/virtuals-protocol-whitepaper-ko/builders-hub/virtuals/agent-contribution/contribute-to-voice-core.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://whitepaper.virtuals.io/virtuals-protocol-whitepaper-ko/virtuals-1/the-protocol/ai-1/ai/ai-nft/ai-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
