M MY Multiplayer: Wiki
Lado
Tipo

getSoundMetaTags

Cliente

Lê as tags do arquivo de áudio (ID3 do MP3, comentários do OGG e do FLAC, INFO do WAV).

table|string|false getSoundMetaTags(sound sound [, string format = ""])

Parâmetros

NomeTipoDescrição
soundsoundO elemento sound, ou um elemento dui para o som do navegador.
formatstringUm formato de tags como %ARTI - %TITL. Vazio devolve a tabela com todas as tags.padrão ""

Retorno

Sem format, uma tabela com os campos que o arquivo tem: title, artist, album, genre, year, comment, track, composer, copyright, subtitle, album_artist. Com format, o texto montado. false se o texto sai vazio ou o som não foi encontrado.

Exemplo

local music = playSound("sounds/track.mp3")
local tags = getSoundMetaTags(music)
outputDebugString(("Tocando agora: %s - %s"):format(tags.artist or "?", tags.title or "?"))

Veja também