Speaker Troubles


(Moonkey) #1

I need to make a certain sound in my map stop on command.

As far as I can tell from searches, there is no way to stop a regular speaker, so I tried making it looped. This goes on and off fine, but there is a definate start to the wav I am using so it wont always be at the right part of the loop when activated.
Is there any way to reset a looping sound to the start of the wav?

I could also use playsound on a script_mover if that makes things any easier.

Also, wondering about this:

playsound <soundname OR scriptname> [LOOPING] 
Currently only allows playing on the VOICE channel, unless you use a sound script. Use the optional LOOPING paramater to attach the sound to the entities looping channel.

I’m not sure about the Voice channel bit. If I use this, will it conflict with any other sounds? (mission briefing for example?)


(C) #2

Almost 3 years later i have the same problem. I want to use a looped speaker because of its range property. (if i use a non-looped speaker, the range doesn’t work correctly; It is always 1024 so it seems).
A target_speaker has no range property, and even though i set the volume of the sound quite low, i can hear those sounds from great distances (1024?), but not that loud anymore… obviously.


(Mark.C) #3

check the LDR, their is a tutorial of in-game speaker editing their.


(RayBan) #4

you should be able to alertentity a speaker thats looped and set to not start off, use the speaker editor, make a speaker and give it a targetname


(C) #5

I know how to read the funky manual…
I’ve already used many speakers in my map, (and target_speakers as well).
Some better explaination of my “problem” (i hope):

  1. A speaker with the following properties: Loop=off, broadcast=no, range=128,targetname=“nameit1” will work properly when triggered with disablespeaker/enablespeaker. The sound will not be heard when out of range (128 in this case). RANGE DOES WORK.
    Once the sound is playing (looped), one can stop playback using the disablespeaker command, and continue playback with the enablespeaker command. This speaker DOES NOT start PLAYBACK FROM THE BEGINNING OF THE SAMPLE, everytime you trigger it on. It keeps on “playing”, even when it doesn’t make any sound at all (when speaker is disabled). When you use an enablespeaker-command again, the sample continues to play from whatever position it was at that very moment. The sample does not start anew (from position 0).

  2. A speaker with these properties: looped=no, broadcast=no, range=128, targetname=“nameit2” will even be heard when moving out of range of the speaker (128 in this case). RANGE DOES NOT WORK. The range of the speaker seems to be fixed at 1024.
    This speaker, however, CAN be triggered to PLAYBACK FROM THE BEGINNING OF THE SAMPLE. (simply use disablespeaker,enablespeaker…even when it’s playing already).

My issue is: I want to create a speaker that can be triggerd to start playback from the beginning of the sample, AND, with a range that works.

btw. An alertentity “nameit1” command will generate the following error: alertentity cannot find targetname “nameit1”. I had already tried that one :slight_smile:

Thanks for the replies!


(Flippy) #6

Sorry i dont know… but:

Why?

I had this same problem before, only with a targetname of “door1”. it could not find the targetname and i was 100% sure that there were no typos or mistakes…


(C) #7

Flippy, I just made up the speaker-names in my previous post. :slight_smile:
It doesn’t matter how a speaker is named; You just cannot use alertentity on a speaker. Eventhough there is a speaker with such a name.


(Flippy) #8

oh ok, i thought you were saying the game couldnt use “nameit1” for some reason… but my “door1” was a script_mover, not a speaker… oh well