x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Set sound doesn't find my audio file

Hi all, I'm trying to create a toggle sound, one that plays when a button is held, and stops immediately when it is released. I was following a thread here, where it was told to use the set sound command to bind the sound cue to an audio component, then one can play and stop it. I did just that and I get errors that I do not have the file to play, even if I do, I could not set the file as default to my audio component. Any ideas? Thanks in advance.

Product Version: UE 4.12
Tags:
more ▼

asked Jul 18 '16 at 11:40 AM in Blueprint Scripting

avatar image

agiro
95 8 12 18

avatar image Prithvi Singh Jul 18 '16 at 11:46 AM

which thread ? why don't you use play sound 2D or spawn sound or simply play sound at location?

avatar image Prithvi Singh Jul 18 '16 at 11:48 AM

why don't you use spawn sound? and simply stop that by press (save it as variable) sound is .wav right?

avatar image Prithvi Singh Jul 18 '16 at 11:58 AM

you are not using SET to set the audio component are you? you are sure you using SET to to the sound (set sound node?)

avatar image Prithvi Singh Jul 18 '16 at 12:00 PM

can you share a pic of BP you have made so far?

just attach it on answerhub using the add image button at top (of comment/answer section)

avatar image agiro Jul 18 '16 at 12:23 PM

Greetings! Here is the rig: [URL=http://s1268.photobucket.com/user/agiro8747/media/issue2_zpsp8c6t4pf.png.html][IMG]http://i1268.photobucket.com/albums/jj563/agiro8747/issue2_zpsp8c6t4pf.png[/IMG][/URL]

avatar image agiro Jul 18 '16 at 12:25 PM
avatar image Prithvi Singh Jul 18 '16 at 01:07 PM

may i know here your sound component is?

avatar image agiro Jul 18 '16 at 12:59 PM

By the way, how to stop a sound from playing when using the play sound function? I use play sound everywhere, except here.

avatar image Prithvi Singh Jul 18 '16 at 01:10 PM

by using spawn sound 2D you can

avatar image Prithvi Singh Jul 18 '16 at 01:10 PM

see my above comment as well

avatar image agiro Jul 18 '16 at 01:26 PM

@Prithvi Singh with spawn sound, promoting it to a variable then stopping it works, but I get runtime errors, like "attempted to access AudioComponent_1 via property TensionSoundSpawn, but AudioComponent_1 is pending kill from function ExecuteUbergraph..." etc. I did have an audio component on my first setup and it was editable as well :/ I also tried to spawn it only at the event construct, promoting to a variable then play and stop, but that didn't work out. And no, I was not setting the component itself, I was using the SetSound function. I have a .wav file. I have no idea, what the issue is :(

avatar image Prithvi Singh Jul 18 '16 at 01:35 PM

alt text

where is your component? is it in an actor or player? you need to specify that as widgets , i don't think they have one audio component they are supposed to get them from other sources and tell them what to do.

zoy.jpg (378.1 kB)
avatar image agiro Jul 18 '16 at 01:43 PM

It's an audio component reference. Have it where you have it and it has the same colour. How to specify as widget? I did it exactly as you did now and it works, it just gives the same error I mentioned.

avatar image agiro Jul 18 '16 at 01:49 PM

However, no matter how often I START playing it by holding the button, it does not give errors as long as I don't let it finish. As soon as it finishes, I get the error.

avatar image Prithvi Singh Jul 18 '16 at 02:04 PM

like this i give it a reference that this is the component the sound should be in

alt text

zoy.jpg (414.9 kB)
avatar image agiro Jul 18 '16 at 02:08 PM

I don't really have a player character. The game uses widgets only. All other sounds work just fine, this one is malfunctioning (giving errors) only when the sound stops - ends - before I release the button.

avatar image agiro Jul 18 '16 at 02:10 PM

and seems like it doesn't matter if I have a wave or a cue as sound, it gives this error all the time I have the button pressed while the sound is finished.

avatar image agiro Jul 18 '16 at 02:14 PM

Another edit: I got it working with looping sounds, it isn't that big of a deal if I get the tension sound regardless of the part moving or just under tension. Now, does this spawning create sound components over and over again, or it just creates one? I have this spawning the way you showed. I'm curious because of the limited memory that mobile devices have.

avatar image Prithvi Singh Jul 18 '16 at 02:27 PM

i don't know about that but it does have a destroy component node but looping should just loop it not replicate /duplicate

avatar image agiro Jul 18 '16 at 02:30 PM

Yes it just loops, but I press and release the button hundred of times along the game.

avatar image Prithvi Singh Jul 18 '16 at 02:42 PM

then just a destroy component after it stops ,so it destroys them when they stop (not sure if destroy component is working)

avatar image agiro Jul 18 '16 at 02:44 PM

Yeah, did just that. It works now.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question