This article's documentation is for anything that uses the Source engine. Click here for more information.

Play: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:play}} {{syntax|play <sound_name>}} Play a sound where "<code>sound_name</code>" is the specified sound with the path from <sound/>. Example: <code>play "comm...")
 
No edit summary
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:play}}
{{lang|play}}{{this is a|console command|name=play}}
{{syntax|play <sound_name>}}
{{syntax|play <sound_name>}}


Line 8: Line 8:
This will play the sound "stuck1.wav" in the folder "sound/common/".
This will play the sound "stuck1.wav" in the folder "sound/common/".


{{note|If you omit the file extension, it will also works if the file is a .wav sound.}}
{{note|If the file extension is omitted, [[.wav]] will be inferred.}}


{{warning|If you trigger this command from a map in Hammer editor, never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor in order to recover your map.}}
{{warning|If you trigger this command from a map in Hammer editor, never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor in order to recover your map.}}
{{clarify|Does this work with [[soundscripts]], or only loose files?}}


[[Category:Console Commands]]
= See also =
* {{ent|playvol}}

Latest revision as of 18:20, 16 September 2024

English (en)Русский (ru)Translate (Translate)

play is a console command available in all Source Source games.

Syntax: play <sound_name>

Play a sound where "sound_name" is the specified sound with the path from <sound/>.

Example: play "common/stuck1.wav" This will play the sound "stuck1.wav" in the folder "sound/common/".

Note.pngNote:If the file extension is omitted, .wav will be inferred.
Warning.pngWarning:If you trigger this command from a map in Hammer editor, never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor in order to recover your map.
Clarify: Does this work with soundscripts, or only loose files?

See also