New Audio API [Beta]: Elevate Sound and Voice in Your Experiences

is it me or am i unable to hear myself through walkie talkies
i’m testing them on my phone using the place file provided in the post

11 Likes

Oh this is so neat stuff! I’ve waited so long for an audio update!
I do have a few questions though, there’s a few features I was hoping we’d get as well but don’t see on the list.

  1. Can we get real-time scripted audio generation / modification?

    One thing I’ve really wanted in Roblox for a long time is being able to generate an audio-source in-game or modify existing sounds through script.

    I’d imagine you use a function to get a array of samples, apply some function on them and then send them to an audio buffer so it can be played.

    Would be super cool for audio synthesis or making custom sound effects (since Roblox can’t implement every sound effect that exists).
    Would be neat if it was possible to make a music studio in Roblox that doesn’t use pre-defined sound files or effects.

  2. Will we get more distortion types?

    There actually exists a lot of distortion types in the world of sound design, impossible to implement all of them into Roblox but a few extra would be nice.

    I’m thinking of things like a soft-clipper (or waveshaper so you can make custom distortions), band distortion (only distorts a given frequency band without touching the rest), tube distortion, prism distortion, etc, basically the popular distortion types that are used in music.

Though, if we could script our own sound effects and manipulate audio at the sample-level then Roblox would practically never have to make another audio effect into the engine ever again since almost any algorithm can be written in Luau and with Native Luau it would be almost as fast as a C++ implementation.

Now for those who don’t know.

What's soft-clipping / waveshaper distortion?

Soft-clipping is simply, making a sound more distorted if it hits a certain peak but “disabling” the distortion when the volume lowers.

Makes things like kicks or other impactful sounds sound hard or crunchy at the beginning and then decrease.

A waveshaper just another type of “soft-clipper”.

Usually you can define your own shape in it, it allows you to reshape a sound to change it’s tone and texture, usually with a curve.

FL Studio examples of waveshaper and soft-clippers.

softclipper

waveshaper

These are also pretty easy to code yourself in practice if Roblox ever allowed sample-manipulation with Luau (excluding over-sampling).

19 Likes

Can we finally use spatial voice with non-humanoids? And are any limits changed? I.e not limited to experiences up to 50 players

13 Likes

with AutoLoad = false, the AudioPlayer will load its asset when it’s first :Play()ed; the asset may be unloaded under memory pressure, but we won’t do that very aggressively since you might want to play it again :sweat_smile:

If you want to forcibly unload the asset, you could set the AssetId to empty, then set it back – that should reclaim the memory

16 Likes

Thanks for the workaround. Would setting AutoLoad to true during runtime load the sound without needing to call Play()?

12 Likes

this is awesome :happy3::happy3::happy3::happy3: I will finally be able to do takiwalkies!! woo

14 Likes

Yes; that also works – when AutoLoad becomes true, it will also load the asset

17 Likes

Thank you for the info! Very glad to see this type of transparency and communication with developers.

12 Likes

Finally its possible to create loudspeakers and more crazy stuff, W update.

11 Likes

This is a genuinely amazing update. Updates to the audio API were requested for a very long time. Can’t wait to see what people do with it!

7 Likes

Will SoundEffect instances be deprecated in favor of these new audio modifying Instances?

8 Likes

So now I can make a public announcement system?

7 Likes

I think it’s because it’s in beta so means you can’t use it on your phone yet?

7 Likes

I am a bit of a bolt but, how would we make certain audios play louder in volume? How do i go about that?

5 Likes

AudioAnalyzer can analyze any audio stream; so AudioPlayers and AudioDeviceInputs alike!

Does new audio instances run heavier and is there limit to how much audios played?

There shouldn’t be any significant difference in processing; the new API is using a lot of the same bones, it’s just comprised of smaller pieces.

One AudioPlayer wired to one AudioEmitter is roughly the same as one Sound in terms of memory & cpu usage – but there are opportunities to mix & match for better performance – e.x. you can have one AudioPlayer wired to two or more AudioEmitters, which will be more efficient than duplicating Sounds

Does new audio instances suffers less from stuttering when there’s too much audio processing going on

The audio may still stutter if there’s a lot of processing – Reverb is one of the heaviest effects, so if you can reuse fewer reverbs between many streams, that would help

13 Likes

Cool update! Is there a way to bind to when a sound is heard by a listener? One of the things I’ve always wanted to do is add auto-captioning for sounds the player hears, but the only way to do that is to bind to every sound in the game and manually calculate the distance, and also feed SoundService:PlayLocalSound() through a wrapper function since I believe that doesn’t fire sound events.

13 Likes

Since this API is live, what does this mean exactly? Is it in beta in that its incomplete and will only be extended or should we anticipate breaking changes based on feedback going forward?

We are not planning to make any breaking changes; if for some reason we do need to, we will communicate that separately, and in advance

We do think we’ll add onto the API, though – we’re starting off with a somewhat limited set of functionality that we’re confident in, and can extend with feature requests

Since this is a beta, we are relying on the community to report bugs & submit feature requests so that we can fix & address those as soon as possible. We will keep this post updated with any future known issues

13 Likes

This is really nice! Some features I’ve wanted for years are here. Thank you!!

I was also wondering, is/will there be a way to SMOOTHLY interpolate sound in either volume or pitch? Currently there’s no way to adjust these properties on any step other than your framerate, so it ends up sounding quite bad. This makes it basically impossible to make car sounds that behave and sound correct.

13 Likes

i don’t know how to use the audio listener to make ranged audio players, i tried right now and it destroyed my ears

9 Likes

You could wire an AudioListener to an AudioAnalyzer to get volume measurements of what was heard by that listener

12 Likes