> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XSpeechSynthesizerCreateStreamFromSsml

> XSpeechSynthesizerCreateStreamFromSsml

# XSpeechSynthesizerCreateStreamFromSsml

지정된 SSML로부터 음성 합성 스트림을 만듭니다.

## 구문

```cpp theme={null}
HRESULT XSpeechSynthesizerCreateStreamFromSsml(  
         XSpeechSynthesizerHandle speechSynthesizer,  
         const char* ssml,  
         XSpeechSynthesizerStreamHandle* speechSynthesisStream  
)  
```

### 매개 변수

*speechSynthesizer*   \_In\_\
형식: XSpeechSynthesizerHandle

사용할 음성 합성기입니다.

*ssml*   \_In\_z\_\
형식: char\*

말할 SSML 수정 텍스트입니다. SSML 태그에 대한 자세한 내용은 [W3C 권장 사항](https://go.microsoft.com/fwlink/p/?LinkID=201763)을 참조하세요.

> [!NOTE]
>
> 이 API는 호출자가 SSML의 버전 1.0을 사용해야 합니다.

*speechSynthesisStream*   \_Out\_\
형식: XSpeechSynthesizerStreamHandle\*

*text*에 지정된 일반 텍스트에서 생성된 음성을 나타내는 음성 합성 스트림입니다.

### 반환 값

형식: [HRESULT](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

성공하면 **S\_OK**를 반환하고, 그렇지 않으면 오류 코드를 반환합니다. 오류 코드 목록은 [오류 코드](https://docs.xbox.com/ko/reference/errorcodes.md)를 참조하세요. 음성 합성기 스트림이 최대 데이터 크기보다 크기 때문에 함수가 실패하면 반환 값은 **E\_BOUNDS**로 설정됩니다.

## 설명

> [!NOTE]
>
> 이 함수는 시간에 민감한 스레드에서 호출하기에 안전하지 않습니다. 자세한 내용은 [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)를 참조하세요.

* 이 함수를 사용하여 일반 텍스트에서 음성을 합성하고 WAVE 컨테이너(`audio/wav` MIME 형식) 형식의 오디오 데이터를 생성합니다. 이 함수를 사용하여 음성 합성기 스트림을 만들고 일반 텍스트에서 음성을 합성한 후, [XSpeechSynthesizerGetStreamDataSize](https://docs.xbox.com/ko/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize.md) 및 [XSpeechSynthesizerGetStreamData](https://docs.xbox.com/ko/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata.md) 함수를 사용하여 음성 합성기 스트림에서 오디오 데이터를 검색합니다. 오디오 데이터를 검색한 후에는 [XSpeechSynthesizerCloseStreamHandle](https://docs.xbox.com/ko/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle.md) 함수를 사용하여 음성 합성기 스트림을 닫습니다.

* 음성 합성기 스트림의 최대 데이터 크기는 0xffffffff 바이트(4기가바이트에서 1바이트를 뺀 값)입니다. 최대 데이터 크기보다 큰 음성 합성기 스트림을 만들려고 하면 오류가 발생합니다.

* 메모리 누수를 방지하려면 핸들을 사용하는 모든 작업을 완료한 후 [XSpeechSynthesizerCloseStreamHandle](https://docs.xbox.com/ko/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle.md) 함수를 호출하여 음성 합성기 스트림 핸들을 닫습니다. 이 함수를 호출하기 전에 모든 진행 중인 비동기 작업이 완료되어야 합니다.

* **XSpeechSynthesizerCreateStreamFromSsml** 함수를 사용하는 방법을 보여 주는 예제는 [XSpeechSynthesizerCreate](https://docs.xbox.com/ko/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)를 참조하세요.

## 요구 사항

**헤더:** XSpeechSynthesizer.h

**라이브러리:** xgameruntime.lib

**지원 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 참고 항목

[XAccessibility](https://docs.xbox.com/ko/reference/system/xaccessibility/xaccessibility_members.md)\
[XSpeechSynthesizerCloseStreamHandle](https://docs.xbox.com/ko/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle.md)\
[XSpeechSynthesizer](https://docs.xbox.com/ko/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)


## Related topics

- [XSpeechSynthesizer (API 콘텐츠)](https://docs.xbox.com/ko/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)
- [Unity 프로젝트에서 GDK API용 C# 래퍼 사용](https://docs.xbox.com/ko/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XSpeechSynthesizerCreateStreamFromText](https://docs.xbox.com/ko/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md)
- [XSpeechSynthesizerCreate](https://docs.xbox.com/ko/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [텍스트 음성 변환](https://docs.xbox.com/ko/build/console-features/text-to-speech/text-to-speech.md)
