GetSoundMetaTags: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Undo revision 26129 by SuN (talk) (Completely broken and useless example. Learn what this function does and test your example properly))
No edit summary
Line 15: Line 15:


==Example==  
==Example==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">addEventHandler("onClientSoundFinishedDownload",root,function(length)
-- TODO
local meta = getSoundMetaTags(source)
outputChatBox("The sound: "..(meta.title).." has finished in :"..length.."ms.")
        outputChatBox("The sound meta tags: Artist:"..(meta.artist).." Album:"..(meta.album).." Genre:"..(meta.genre).." Year:"..(meta.year).." Comment:"..(meta.comment).." Track:"..(meta.track).." Composer:"..(meta.composer).." Copyright:"..(meta.copyright).." SubTitle:"..(meta.subtitle).." Album Artist:"..(meta.album_artist)..".")
end)
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Client_audio_functions}}
{{Client_audio_functions}}
[[Category:Needs_Example]]

Revision as of 07:05, 28 June 2012

Used to get the meta tags attached to a sound. These provide information about the sound, for instance the title or the artist.

Syntax

table getSoundMetaTags ( element sound )

Required Arguments

Returns

Returns a table with all data available (keys are listed below) for the sound if successful, false otherwise.

  • title
  • artist
  • album
  • genre
  • year
  • comment
  • track
  • composer
  • copyright
  • subtitle
  • album_artist
  • stream_name
  • stream_title

Example

addEventHandler("onClientSoundFinishedDownload",root,function(length)
	local meta = getSoundMetaTags(source)
	outputChatBox("The sound: "..(meta.title).." has finished in :"..length.."ms.")
        outputChatBox("The sound meta tags: Artist:"..(meta.artist).." Album:"..(meta.album).." Genre:"..(meta.genre).." Year:"..(meta.year).." Comment:"..(meta.comment).." Track:"..(meta.track).." Composer:"..(meta.composer).." Copyright:"..(meta.copyright).." SubTitle:"..(meta.subtitle).." Album Artist:"..(meta.album_artist)..".")
end)

See Also