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"

How to subclass AmbientSound

To add special playback logics to an AudioComponent contained in a AAmbientSound actor, I tried to subclass AmbientSound through Unreal Editor's Add Code to Project, however the editor complains that "Failed to add class . Failed to automatically compile module." If its not possible, why?

Product Version: UE 4.7
Tags:
more ▼

asked May 22 '15 at 03:44 AM in C++ Programming

avatar image

KidBroker
20 3 5 8

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I'm not sure why - it could have something to do with the "MinimalAPI" specifier in the code.

Anyway AmbientSound is a really thin wrapper around AudioComponent: it'll be easier and more flexible for you to create an Actor Blueprint from scratch, add it an AudioComponent and control it from the actor graph.

more ▼

answered May 22 '15 at 08:59 AM

avatar image

G4m4
690 26 15 33

avatar image KidBroker May 23 '15 at 04:13 AM

Thanks but in code, is there a way I could get a reference to the AmbientSound actor which is manually added to UWorld? then I could dynamically add and delete audiocomponent from it.

avatar image G4m4 May 23 '15 at 08:34 AM

You have different ways to do this:

  • When you're spawning the actor from the code, keep a reference to it

  • Use the actor iterator to find yours

  • You could create events in the code, and use those in your actor blueprint to add and remove audio component in blueprint

...and probably a lot more. What are you trying to achieve?

avatar image KidBroker May 23 '15 at 01:35 PM

The ultimate goal is to access the raw data from a MediaSoundWave. My inital plan was to create an AmbientSound actor to host an audio component, which can load a MediaSoundWave as a SoundWave to access FByteBulkData RawData.

(comments are locked)
10|2000 characters needed characters left
Your answer
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