Engine Class
AudioTextToSpeech
*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่
สรุป
คุณสมบัติ
วิธีการ
GetConnectedWires(pin: string):{Wire} |
GetWaveformAsync(timeRange: NumberRange,samples: number):{any} |
Pause():() |
Play():() |
Unload():() |
เหตุการณ์
WiringChanged(connected: boolean,pin: string,wire: Wire,instance: Instance):RBXScriptSignal |
ตัวอย่างโค้ด
การแสดงผลข้อความเป็นการพูด
local audioTextToSpeech: AudioTextToSpeech = Instance.new("AudioTextToSpeech")
audioTextToSpeech.Parent = workspace
audioTextToSpeech.Text = "สวัสดี! การแปลงข้อความเป็นการพูดสนุกมาก!"
audioTextToSpeech.VoiceId = "1"
local deviceOutput = Instance.new("AudioDeviceOutput")
deviceOutput.Parent = workspace
local wire = Instance.new("Wire")
wire.Parent = workspace
wire.SourceInstance = audioTextToSpeech
wire.TargetInstance = deviceOutput
local count = 0
local connection = nil
connection = audioTextToSpeech.Ended:Connect(function()
audioTextToSpeech.Text = "ฉันนับได้ถึง " .. count .. " เพราะว่าฉันฉลาดมาก"
audioTextToSpeech.VoiceId = "2"
audioTextToSpeech.TimePosition = 0
audioTextToSpeech:Play()
count += 1
if count > 10 then
connection:Disconnect()
end
end)
audioTextToSpeech:Play()เอกสารอ้างอิงเกี่ยวกับ API
คุณสมบัติ
วิธีการ
GetConnectedWires
GetWaveformAsync
พารามิเตอร์
ส่งค่ากลับ
Pause
AudioTextToSpeech:Pause():()
ส่งค่ากลับ
()
Play
AudioTextToSpeech:Play():()
ส่งค่ากลับ
()
Unload
AudioTextToSpeech:Unload():()
ส่งค่ากลับ
()
เหตุการณ์