AudioPages
Hiển Thị Bản Đã Lỗi Thời
*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.
Một phiên bản đặc biệt của lớp Pages được trả về bởi AssetService:SearchAudio() . Xem ví dụ mã sau đây để tham khảo về định dạng dữ liệu trả về.
Mẫu mã
This code gets the music assets returned by the keyword "happy" and prints out their titles.
Getting Music Search Titles
local AssetService = game:GetService("AssetService")
local audioSearchParams = Instance.new("AudioSearchParams")
audioSearchParams.SearchKeyword = "happy"
local success, result = pcall(function()
return AssetService:SearchAudio(audioSearchParams)
end)
if success then
local currentPage = result:GetCurrentPage()
for _, audio in currentPage do
print(audio.Title)
end
else
warn("AssetService error: " .. result)
end
--[[ Returned data format
{
"AudioType": string,
"Artist": string,
"Title": string,
"Tags": {
"string"
},
"Id": number,
"IsEndorsed": boolean,
"Description": string,
"Duration": number,
"CreateTime": string,
"UpdateTime": string,
"Creator": {
"Id": number,
"Name": string,
"Type": number,
"IsVerifiedCreator": boolean
}
}
--]]
Tóm Tắt
Phương Pháp
Phương Pháp kế thừa từ PagesTrả về các mục trên trang hiện tại. Các chìa khóa trong mục được xác định bởi nguồn của đối tượng này.
Lặp đến trang tiếp theo trong đối tượng trang, nếu có thể.
Thuộc Tính
Thuộc Tính được kế thừa từ Pages
Phương Pháp
Thuộc Tính được kế thừa từ Pages