CreateSound3D: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|CreateSound3D(SoundFile, x, y, z [, radius, bLoop])}} {{FuncParameters}} {{FuncParam|SoundFile|__E..." |
No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Client|1.0}} | {{Info|Function|Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Plays a local audio file or over http. Also supports playing .pls network streams. Sound is played in 3D world space. | ||
{{FuncSyntax|CreateSound3D(SoundFile, x, y, z | See [[packages]] what audio file types are supported.}} | ||
{{FuncSyntax|CreateSound3D(SoundFile, x, y, z, radius [, bLooping])}} | |||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|SoundFile| | {{FuncParam|SoundFile|The path to the file to play. Or a HTTP network stream or file.}} | ||
{{FuncParam|x| | {{FuncParam|x|Location X coordinate}} | ||
{{FuncParam|y| | {{FuncParam|y|Location Y coordinate}} | ||
{{FuncParam|z | | {{FuncParam|z|Location Z coordinate}} | ||
{{FuncParam|radius| | {{FuncParam|radius|The radius to where the sound will be heard from.}} | ||
{{FuncParamOptional| | {{FuncParamOptional|bLooping|Whether this sound should loop. Default: false.}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns the sound identifier. Returns '''false''' on error. Once the playback has finished the sound identifier will be destroyed automatically.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
CreateSound3D("http://us4.internet-radio.com:8258/listen.pls&t=.pls", 0.0, 0.0, 0.0, 1000.0) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{Template:SoundFunctions}} |
Latest revision as of 18:50, 14 December 2020
Description
Plays a local audio file or over http. Also supports playing .pls network streams. Sound is played in 3D world space.
See packages what audio file types are supported.
Syntax
CreateSound3D(SoundFile, x, y, z, radius [, bLooping])
Parameters
- SoundFile
The path to the file to play. Or a HTTP network stream or file. - x
Location X coordinate - y
Location Y coordinate - z
Location Z coordinate - radius
The radius to where the sound will be heard from. - bLooping (optional)
Whether this sound should loop. Default: false.
Return Value
- Returns the sound identifier. Returns false on error. Once the playback has finished the sound identifier will be destroyed automatically.
Example
CreateSound3D("http://us4.internet-radio.com:8258/listen.pls&t=.pls", 0.0, 0.0, 0.0, 1000.0)