BookmarkReachedEventArgs 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이벤트에서 데이터를 반환합니다 BookmarkReached .
public ref class BookmarkReachedEventArgs : System::Speech::Synthesis::PromptEventArgs
public class BookmarkReachedEventArgs : System.Speech.Synthesis.PromptEventArgs
type BookmarkReachedEventArgs = class
inherit PromptEventArgs
Public Class BookmarkReachedEventArgs
Inherits PromptEventArgs
- 상속
예제
다음 예제에서는 두 개의 책갈피를 포함하는 프롬프트를 만들고 재생을 위해 출력을 WAV 파일로 보냅니다. 이벤트 처리기는 BookmarkReached 이벤트가 콘솔에 발생할 때 책갈피의 이름과 오디오 스트림의 위치를 씁니다.
using System;
using System.Speech.Synthesis;
namespace SampleSynthesis
{
class Program
{
static void Main(string[] args)
{
// Initialize a new instance of the SpeechSynthesizer.
using (SpeechSynthesizer synth = new SpeechSynthesizer())
{
// Configure the audio output.
synth.SetOutputToWaveFile(@"C:\test\weather.wav");
// Create a SoundPlayer instance to play the output audio file.
System.Media.SoundPlayer m_SoundPlayer =
new System.Media.SoundPlayer(@"C:\test\weather.wav");
// Build a prompt and append bookmarks.
PromptBuilder builder = new PromptBuilder(
new System.Globalization.CultureInfo("en-US"));
builder.AppendText(
"The weather forecast for today is partly cloudy with some sun breaks.");
builder.AppendBookmark("Daytime forecast");
builder.AppendText(
"Tonight's weather will be cloudy with a 30% chance of showers.");
builder.AppendBookmark("Nighttime forecast");
// Add a handler for the BookmarkReached event.
synth.BookmarkReached +=
new EventHandler<BookmarkReachedEventArgs>(synth_BookmarkReached);
// Speak the prompt and play back the output file.
synth.Speak(builder);
m_SoundPlayer.Play();
}
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
// Write the name and position of the bookmark to the console.
static void synth_BookmarkReached(object sender, BookmarkReachedEventArgs e)
{
Console.WriteLine("Bookmark ({0}) reached at: {1} ",
e.Bookmark, e.AudioPosition);
}
}
}
설명
BookmarkReachedEventArgs 인스턴스는 개체가 SpeechSynthesizer 이벤트를 발생 시에 만듭니다BookmarkReached. SpeechSynthesizer 이 BookmarkReached 이벤트는 , Speak또는 SpeakAsyncSpeakSsml메서드를 처리하는 동안 책갈피를 SpeakSsmlAsync발견할 때 발생합니다. 이벤트를 트리거한 책갈피의 이름과 위치를 가져오려면 이벤트 처리기의 속성 및 Bookmark 해당 속성에 액세스 AudioPosition 합니다.
속성
| Name | Description |
|---|---|
| AudioPosition |
책갈피에 도달한 시간 오프셋을 가져옵니다. |
| Bookmark |
도달한 책갈피의 이름을 가져옵니다. |
| Cancelled |
비동기 작업이 취소되었는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 AsyncCompletedEventArgs) |
| Error |
비동기 작업 중에 발생한 오류를 나타내는 값을 가져옵니다. (다음에서 상속됨 AsyncCompletedEventArgs) |
| Prompt |
이벤트와 연결된 프롬프트를 가져옵니다. (다음에서 상속됨 PromptEventArgs) |
| UserState |
비동기 작업에 대한 고유 식별자를 가져옵니다. (다음에서 상속됨 AsyncCompletedEventArgs) |
메서드
| Name | Description |
|---|---|
| Equals(Object) |
지정된 개체가 현재 개체와 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| GetHashCode() |
기본 해시 함수로 사용됩니다. (다음에서 상속됨 Object) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| RaiseExceptionIfNecessary() |
비동기 작업이 실패한 경우 사용자가 제공한 예외를 발생합니다. (다음에서 상속됨 AsyncCompletedEventArgs) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |