Download

Question about Audio Source Settings

The current project I’m working on was to be created in Unity, but I switched over to UE for various reasons. One of the features in my game was to capture audio that could not be heard. Within Unity, you could actually toggle an AudioSource to play at start of the game and loop, but toggle Mute so initially the player was unable to hear it. The sound clip would loop indefinitely, but you never would hear it. Just briefly looking over actors in UE, I don’t know if there is option to set sound up in a similar way. Is that possible.

In Unity, I was having the raw data from the audio stripped at the time it was being captured at any specific point (if the player was in range of the initial AudioSource), and streamed into an array that I used to create another AudioSource. I had to step through the streaming on each tick to make sure each chunk of audio wasn’t going to be overlapped with previous audio in the array. (You’d have a very LONG audio clip) Then player could replay the new captured audio clip which wasn’t muted from their position. (Think EVPs) There wasn’t much documentation on audio manipulation in Unity, but was extremely satisfied to have figured it out. And I’ll admit I haven’t began to look in UE docs.

But for more experienced users, are there existing API calls in this engine that could similarly handle that sort of logic? I would hope so as it is pretty important to my project.

So if I understand correctly you would put a looping sound in the world that the player can’t hear, but does play. And when you use some kind of recording device in the game, that recording device would record that silent audio and replay it to you later?

Recording audio during the game, that is very experimental. I haven’t seen any support for that come by and I doubt it exists.

There are sound classes and sound mixes. These allow you to classify sounds and then apply a certain mix to just that class of sounds. That way you can easily silence all sounds of a certain type for example. That is how you’d handle muffling environment sounds when underwater, but not altering for example menu sounds (different sound class). If you will end up writing your own recording thing, I’d ensure that can only record a specific sound class. So I don’t think that part is what is difficult. Getting it to actually recording anything that is probably the hardest bit of this.

That is precisely what I mean.

Does UE4 support rudimentary audio classes that at least read in audio data?

Unity didn’t really have any “recording” audio per se either. It did have two methods from the audio class though, called GetOutputData and SetData. One would read the audio data streaming through the emitter, the other would set an array of data to be usable by an audio emitter. Using those two methods, I was able to “record” audio from a sound source that wasn’t audible. There was an actual recording method that would record audio that the player actually did hear that I was also going to use.

UE4 is so feature rich, I was so expecting it to have this as well. I was wanting to easily port my code over. Is this something that requires engine changes, because while I know C++ some and I’m trying to learn the system, I’m in no way experienced or proficient enough to extend the engine.

This most certainly requires engine changes I’d say (or at least a good bit of C++ programming on top of the existing engine), unless you can find a way to fake it. Maybe you can find a setup that doesn’t truly record sound, just plays a certain track in a certain way?

Other than that I think you better turn to the C++ forum section for this question. This goes beyond content creation.

I’m in the same boat. I’ve been trying to do an audio type game in UE and its been hell. UE is so powerful, but when it comes to sound, all it really wants do is play a file when triggered. No audio streams, or microphone support, or FFT, etc… The devs will tell you that all of the pieces are there and can point you to different parts of the engine, but good luck putting it all together. You’ll have to download the source and dig deep into the code that was really created for different uses. I love this engine, it’s 50x better then Unity, but the audio system is the one place where it falls short.

I went ahead and added a C++ forum post if anyone is interested in adding to it here.

When I was digging through Unity, there was sparse documentation on what I wanted to do, and how to use, but at least it was there. Looking at stuff in UE4, I don’t know what any of that does. And since audio is the last thing on people’s mind, its not something you find help on. Lets all just make the next Slenderman game, or some military shooter, no need for audio support. At least thats where I was sitting with Unity. A feature that is very important in my project far exceeds my experience with this engine. I hope I can find some breakthrough soon.