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 do I get the audio data of an input sound node?

Hi! I am trying to write a custom audio filter. I want to implement it as a SoundNode with one input and one output, so that I can use it in blueprints. As far as I have understood the method USoundNode::ParseNodes evaluates all the child nodes connected to a sound node. Now my question is: how do I get the raw sound data of the input sound node?

Note: The question below is very similar, but since it is already quite old and there was no helpful answer, I thought I'd ask again. https://answers.unrealengine.com/questions/131767/how-to-create-an-audio-filter-plugin-in-ue4.html

Product Version: UE 4.10
Tags:
more ▼

asked Jan 05 '16 at 08:06 AM in C++ Programming

avatar image

S a d j a d
28 2 3 5

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

2 answers: sort voted first

The answer in the thread you linked is still valid: there is no real way to do that at the moment, which sort of make sense if you think of how audio is handled on, say, a platform like the Xbox: you create buffers and handle them through the XAudio API but at no point you actually have access to them.

Hopefully the audio engine overhaul that has been announced will allow such processing, maybe by allowing some buffers to roundtrip through memory.

more ▼

answered Jan 07 '16 at 04:36 PM

avatar image

G4m4
695 27 15 34

avatar image Minus_Kelvin STAFF Jan 11 '16 at 06:36 PM

It's not accurate to say the reason you can't access a voice audio stream for user effects/DSP is because of XAudio2. I implemented the Oculus Audio SDK (which required access to the audio stream of a voice) by creating a per-voice XAPO audio effect and attaching it to an IXAudio2Voice (given the necessary conditions are met). You could do something similar for general effects and call into a platform-independent interface (like I did with spatialization plugin) that then calls into some user-processing callback.

This just hasn't been done yet because it'd be quite a bit of work to do it and I plan on doing something similar anyway with the audio engine rewrite soon. I've not worked on the rewrite for a while in favor of getting some much needed leaf-features into the engine for Paragon (e.g. a more robust concurrency system, a focus system, occlusion, and a number of other smaller things).

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

Using ParseNodes would be enough for simple effects but for more complicated things you should look into the FAudioEffectsManager (your node could control an effect). That's how reverb or the radio effects are done. Check FCoreAudioEffectsManager or FXAudio2EffectsManager for the actual implementations (they are platform dependent).

Another way would be adding come special code when the PCM data is submitted into the system, this happens in FSoundSource::SubmitPCMBuffers, again each platform has it's own FXAudio2SoundSource for example.

You would require a source build to be able to add your own effects into the engine though.

more ▼

answered Jan 05 '16 at 07:45 PM

avatar image

Moss
6.4k 127 98 607

avatar image S a d j a d Jan 05 '16 at 11:39 PM

Even for the simplest effect I will need to process the actual samples of the child node's waveform. So does ParseNodes provide this functionality somehow?

avatar image Moss Jan 07 '16 at 06:23 PM

As @G4m4 said, for now it is not possible doing it an Node. You could though add your special code where the audio buffers are created from the PCM data within FSoundSource but it does require engine modifications.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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