CreateSound3D: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
Line 3: Line 3:
{{FuncDescription|Plays a local audio file or over http. Also supports playing .pls network streams. Sound is played in 3D world space.}}
{{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, radius)}}
{{FuncSyntax|CreateSound3D(SoundFile, x, y, z, radius [, bLooping])}}


{{FuncParameters}}
{{FuncParameters}}
Line 11: Line 11:
{{FuncParam|z|Location Z coordinate}}
{{FuncParam|z|Location Z coordinate}}
{{FuncParam|radius|The radius to where the sound will be heard from.}}
{{FuncParam|radius|The radius to where the sound will be heard from.}}
{{FuncParamOptional|bLooping|Whether this sound should loop. Default: false.}}


{{FuncReturnValue|Returns the sound identifier. Returns '''false''' on error. Once the playback has finished the sound identifier will be destroyed automatically.}}
{{FuncReturnValue|Returns the sound identifier. Returns '''false''' on error. Once the playback has finished the sound identifier will be destroyed automatically.}}

Revision as of 13:56, 14 August 2020

CreateSound3D

Type: Function
Context: Client
Introduced: v1.0

Description

Plays a local audio file or over http. Also supports playing .pls network streams. Sound is played in 3D world space.

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)

See also