#šŸ”Šā”ƒaudio

1 messages Ā· Page 5 of 1

tribal panther
#

Never used Steam Audio before, but AFAIK you need to attach an Steam Audio Source to any object which produces a sound in other to use the Steam Audio systems

hard gulch
#

Your events should have a Steam Audio Spatializer though

tribal panther
hard gulch
#

I have only used the HRTF/spatialization feature of steam audio

#

Which works with createinstance

tribal panther
#

(We want to use the Steam Audio so sounds take into account walls from rooms, as at the moment they ignore walls)

hard gulch
#

In the effects of the event you know

#

But theres a chance that you need steam audio source for occlusion

hard gulch
#

And possibly reflections

tribal panther
#

Oh, I'm not very familiar with the names of this effects, thanks

#

So for occlusion I can no longer use RuntimeManager.CreateInstance?

hard gulch
maiden quarry
#

Hi all. I am using TTS for voicing on of my game characters, who is an AI gone wrong, so it fits nicely. But I still wanna add some filters to the audio to make it real ominous sounding. Any advice on what free software I can use to get this done? Thanks!

hard gulch
#

You could either use the audio effects included in unity, or apply some effects with Audacity (free) or Reaper (not free but has unlimited trial)

mellow finch
#

heyup, anyone know if there's way to get FMOD audio to scrub correctly in Timeline? It seems to always play audio from the start as you scrub past events

frigid harness
#

can you guys check out this part of the main menu music im working on? any feedback is appriciated! :)

tribal panther
#

Using FMOD + Steam Audio, how can I play a sound by code? If I do it like I would do with just FMOD, it doesn't works as Steam Audio spatialization requires and Steam Audio Source component.

orchid thicket
#

Hey! I just ran into a bugg on 2022.3.32.
If you have multiple audiosources on a gameobject and call .stop() on one of them, it ends up muting all of the audiosources on that gameobject instead of only the targeted one

#
public AudioSource audio1;
public AudioSource audio2;

private void Start()
{
  audio2.Stop(); // this will also stop audio2 if they are on the same gameobject
}```
delicate rivet
#

double check audio1 and audio2 are not referencing the same AudioSource

quasi hound
#

If you stop a source that's playing multiple clips, they are all expected to stop

#

"Stopping" a clip shouldn't really be a thing as far as I know

orchid thicket
quasi hound
orchid thicket
quasi hound
orchid thicket
#

@quasi hound Ive already checken all of that, and it got solved when I changed one of the audiosources to a child object instead.

Like I said in my first post, this is a bug.
I was mostly wondering if others were aware of it.

delicate rivet
hard gulch
#

Steam audio spatialized sounds work fine for me in Unity. I don't use SteamAudioSources, just regular FMODUnity.RuntimeManager.CreateInstance

stuck arch
#

Hi, I'm currently trying to set up playing multiple audio sources back to back seamlessly using dspTime and PlayScheduled. My current use case is:

  • play an intro to a song
  • loop the middle of a song
  • detect when the audio source loops/changes and access the progress of the current source
    The main questions I have about this are with scheduling the start time. I understand the need to schedule in the future by adding to the current dspTime, but all the examples I can find online use an arbitrary float value (Example from unity: https://docs.unity3d.com/ScriptReference/AudioSource.PlayScheduled.html). My questions are as follows:
  • Is there a better way to schedule audio than by adding a magic number to the current dspTime?
  • If not, what's the typical range to play around in to play something as soon as possible without running into desync issues? Is it possible to completely prevent desync in high-lag situations?
  • Should I be looking into something else entirely that better handles my use case?
    Thanks!
kindred thicket
tribal panther
stuck arch
cosmic night
#

Hey, is there a way to play audio at point in AudioSource component like if it was played by AudioSource.PlayClipAtPoint?

quasi hound
spiral talon
#

can i create audiorolloff presets or do i have to make new ones for every audiosource?

kindred thicket
# stuck arch Currently, I'm primarily aiming for a standalone app

I have some understanding about PlayScheduled in Unity 2019.4, just sharing my observations:

  • Technically on internal FMOD side it's a delay (something like ChannelControl::setDelay), scheduled AudioSource will take 1 voice, so AudioSource.isPlaying will return true even if it doesn't make sound.
  • AudioSource.PlayScheduled works best with Decompress On Load and worst with Streaming Load Type. Decompress On Load increases RAM usage, but since audioclip is stored uncompressed, you can instantly run AudioSource.PlayScheduled(dspTime) without latency. For Streaming type you need to add latency, i.e. 'magic number'.
  • AudioSource.PlayScheduled has sufficient accuracy for sample-by-sample sync, but in my standalone tests there were rare cases of time shifting by 1024 samples = 21ms @ 48000Hz samplerate.
  • AudioSource.PlayScheduled can break timing in Unity Audio Filters - Reverb Filter, Echo Filter, Chorus Filter.

Despite the issues, you can still create music audio system. I recommend '140' by Jakob Schmid, it is first game on Unity 3.5 that actively uses scheduled AudioSources.

vapid coral
#

Any recommendations for reliable royalty free SFX? I’m usually bouncing between Pixabay and Freesound but I’m struggling to find some specific fx

#

I figured this would be related enough to this channel so hopefully I’m not being annoying ZeriSweat

quasi hound
vapid coral
quasi hound
vapid coral
#

Ohhh

#

Yo it even says it has grunts and battle cries, those are what I’ve been working on šŸ‘ thanks!!

stuck arch
calm adder
#

Has anyone solved the problem that when playing audio in a loop in a webgl build, there is about 1 frame of silence (gap) every time it loops?

peak kiln
#

does anyone know how to loop an event if it uses a parameter?

feral geyser
#

Hi all. I have a live audiovisual project and about to write a way to define bpm with midi pad, for it to then loop a broadcast event based on the rhythm

#

What i'm wondering about is the 1st part

#

Note: this is not for a beat press rhythm game

#

So i guess i'll use FixedUpdate, and determine if this frame has passed the supposedly next beat, and then update the "lastBeat" time by offsetting the 1/bpm value

#

I think FixedUpdate is good enough for this

#

Or even update, bcoz the resulting broadcast is just for visual trigger

feral geyser
#

Since this is for live, i'll need to calibrate the bpm somehow with just the midi pad press interval

kindred thicket
feral geyser
#

The midi input is sorted

#

Actually i'm already done implementing it

#

But since this is a custom audiovisual thing, i was asking others if they have experience building something like this, how they decide on the controls

#

Currently the midi pad is for manual trigger some fx
Ctrl pad and pressing it following a beat will start sampling the distances between beat, averages it, and sets it as the new beat length
It'll also add the pad to the list of pads to loop for each beat

#

Pressing the midi pad again without Ctrl, will trigger that fx then removes that pad from the registered list of pads that's being looped

kindred thicket
#

Sorry, it's too complicated for me

feral geyser
#

Haha sry it's fine. Just writing out loud maybe someone have something to say. Else it helps me imagine the design

kindred thicket
#

Doing audiovisual stuff is cool, it requires unusual approaches šŸ™‚

tribal panther
#

Question about Audio Source. I know the point of Occlusion it to block sound from moving through solid meshes... but is possible to have a sound source inside a mesh and ignore that mesh (its owner) in particular?

naive thicket
#

@severe eagle There's no promotion in learning channels. If you have a Unity project this is attached to you may post it in #1180170818983051344 . Be sure to read post guidelines.

spice wren
#

Can I have 1 audio source but 5 different audio positions?
I am try to make the 5 speakers in my scene all play the same audio clip and the position of the audio matters because I want spatial audio playing from each speaker.

#

I feel like duplicated 5 audio sources is bad for perf and writing a script sync them would be hacky

kindred thicket
hollow osprey
#

Ok thats maybe a bit much audio sources, but you get what i mean

kindred thicket
#

If you really care about audio system performance on standalone platforms, you should use audio middleware like FMOD Studio or Wwise, there is much less of such overhead there.

hollow osprey
#

True, but technically it like wont matter at 1 real and 1000 virtual devices

kindred thicket
#

btw, Unity had an alternative called DOTS Audio, where it was really possible to play 10,000 audiosources, but project was abandoned.

whole pewter
#

re # of AudioSources: original question was about 5 of them, which would be anywhere near to pose real problem i'd assume

whole pewter
#

those are android (i suppose) specific - you should post in more relevant android channels/outlets
mobile audio has its own.. specifics, which also in case of android depend more on your hw/phone

raw ridge
#

anyone know how I can add button SFX (like clicking sounds) to an audio mixer to manipulate them with an SFX slider/checkbox?

bitter granite
#

Im trying to add SteamAudio on Unity 6 but i have an infinite loop while importing the package
I have follow the documentation but that not work

bitter granite
#

Anyone know how to get the steam audio occlusion working ?
When i enable them, there is not difference.. I have followed the documentation but nothing happens

pallid marten
#

hai im trying to use Unity's timeline to do a quick intro scene, first time using it. I have an animation clip added that moves a GO from one spot to another, and Im trying to implement a sound effect to follow but I can't hear anything. The .wav does play a sound tho. Also the game is in VR, not sure if that changes anything although even when the game isnt playing and im in the editor, the sound doesnt play. I tried attaching the audio to an empty GO and attaching it to the (NONE, audio source) track of the screenshot but that also didnt work. Any tips ?

high sluice
#

i have 3 audios but my 3th audio doesn't go of

#
    private AudioSource audioBouncy;
    private AudioSource audioHit;
    private AudioSource audioExplosion;

    private void Start()
    {
        // Get all AudioSource components attached to this GameObject
        AudioSource[] audioSources = GetComponents<AudioSource>();
    
        if (audioSources.Length > 2)
        {
            audioBouncy = audioSources[0];
            audioHit = audioSources[1];
            audioExplosion = audioSources[2];
        }
        else
        {
            Debug.LogError("Not enough AudioSource components found on this GameObject.");
        }```
#

my debug log does go off

#
            audioExplosion.Play();
            Debug.Log("explosion played!");```
past igloo
mossy tiger
#

Anyone know how to use fmod

sour quarry
#

Does playoneshot bypass audio filters? I have an audio source referenced from another game object, and I have the filters under the same gameobject as the audio source, but I'm not getting any filters. Does anyone know how to perform playoneshot with filters? Or do I have to create an audio source for every sound effects?

rain canyon
#

Was told to ask here, hope it's okay to forward it

quasi hound
rain canyon
quasi hound
#

Is the number of out of range audio sources a tangible drain on resources to begin with?

#

Often if your game levels are sprawling, you'd be loading in the objects gradually by area anyway which makes this less of an issue in particular

rain canyon
#

But like you said those units would come over time.

quasi hound
#

The Real Voice Limit already guarantees a certain threshold for audio culling

#

Your tests should reveal if that's enough or not

rain canyon
#

I'm also curious if Audio Sources "do" anything if they're not playing sound, do those take up resources just for being in the scene?

quasi hound
#

They take up memory, but little to no processing power as far as I know

rain canyon
#

Thank you for your help it's been really useful, I think I understand how it works now a bit better.

quasi hound
#

Also, it's bit of an old adage by now to say that distance checks are awful, from a time with much weaker hardware
Still, those can be optimized
Distance comparisons (using squared magnitude) are much cheaper than distance checks

#

Comparing to a squared distance tells you just as well if you're closer or further

rain canyon
silver coral
#

Where do you guys source sound for your games ive been looking for weapon sounds but they are all either not what I need or they are asking for some stupid subscription fee for something they 100% stole from somewhere else anyway

#

Ive got a gunshot sound I recorded myself but I dont have access to an AK atm and wont for a while

spiral trail
inland raven
cosmic night
#

Is there a way to play audio via AudioSource in stereo like it's in AudioSource.PlayClipAtPoint?

#

Like you hear the sound from the point it's been played

quasi hound
#

PlayClipAtPoint doesn't do anything fancier than to create a gameobject with an audiosource, play it, then destroy it

foggy karma
inland raven
rain canyon
#

im audio pooling in unity 2022.3.26f1 and i was wondering, how does audio pooling work with random pitch looping for things like footsteps? i know in 2023 and up there is an audio random container and that prob helps but im scared footsteps themselves will take up basically all 32 audio sources

#

from what I heard in unity 5 there are also custom limits for audio sources, but for this project updating is not an option (its a group uni project, so the version is the same as on the in-class computers)

quasi hound
swift crown
#

Hello. Something weird happened to my working setup. After I made a clean install of Xubuntu 24.04 and installed Unity Hub with Unity Engine and opened my working project I got errors from FMod plugin basically claiming it couldn't initialize audio (ERR_OUTPUT_INIT Error initializing audio device). Tried refreshing banks, rebuilding fmod project, reinstalling (with purge) alsa and pulseaudio packages, tried even installing another linux distro (Manjaro), but the error persists. The audio is actually seems to be working fine - I can listen to music or watching videos or playing games without any problem. The problem is only in this unity project. Unity version is 2022.3.52 (LTS). Any suggestions on where to dig?
P.S. On windows the project opens and works fine.

rain canyon
#

I was wondering if anyone has any other ideas for what these don't cover: I have a "OnClickSound" script that handles sounds that play when something is clicked. I have a "PlayOnAwake" script which handles static objects like waterfalls, buildings etc that just need to play a sound either once or on loop. Are there any other uses that I haven't covered in these scripts that you can think of?

#

One is random pitch looped sounds, for example footsteps

#

Music will be a separate subsystem

spark cove
#

yo anyone got an idea for a theme song its for a sad game

earnest pasture
#

Is there any reason to use AudioSource.Play instead of AudioSource.PlayOneShot in a scenario where you don't care about stopping the sound as its playing ?

#

The only advantage I found is the ability to cut off the current clip, at the cost of making using the audio system really awkward (from what I understand)

hexed falcon
#

Thought this seemed like the best place to ask this,
but is anyone else having a Vorbis decoder failure when using Unity 6 (6000.0.23f) and Wwise 2024.1.0,
where for some reason all audio that's been converted to Vorbis in generation, cuts off with that error after pretty much exactly 2 minutes.

I don't use Zero Latency like Wwise mentions as a probable cause, and there isn't any errors that come up during the generation itself,
so Im pretty stumpted on what I could try here. Wwise 2023.1.7 works fine in comparison.

fierce ibex
#

Hey, does anyone know how I can have music with an intro loop back to a certain part of the song, so that after the intro it loops the main part?

#

I cant find any good tutorials

flat spruce
#
{
    int frequency = originalClip.frequency;
    int startSample = (int)(startTime * frequency);
    int samplesRequired = (int)(duration * frequency);
    
    float[] data = new float[samplesRequired];
    originalClip.GetData(data, startSample);
    
    AudioClip newClip = AudioClip.Create("Section", samplesRequired, 1, frequency, false);
    newClip.SetData(data, 0);
    
    return newClip;
}



#

that help?

fierce ibex
#

this will allow me to set the looping points in the editor?

flat spruce
#

I don't know

#

but actually you should just use unity's built-in loop points?

fierce ibex
#

oh I didn’t know unity had its own

fierce ibex
#

thanks

flat spruce
#
{
    public AudioSource musicSource;
    
    void Start()
    {
        // Set the loop points
        musicSource.loop = true;
        musicSource.loopStart = 20f;  // Start loop from 20 seconds
        
        // Play from the beginning first time
        musicSource.Play();
    }
}```
#

my first answer is from jippity, second from claude. claude seems to know some tricks.

rain canyon
#

any idea why I can still hear the sound despite being over max distance away from it?

#

unity 2022.3.26f1

rain canyon
#

Spatial Blend is set to 1

#

also another issue - tabbing out of the editor while in playmode ends one of my sounds and puts them back into the pool, as if "isPlaying" gets set to false?

quasi hound
#

So you'd grab the furthest right curve key and set it to zero at where you want the volume to be zero

#

So probably 200

rain canyon
#

also in the screenshot it looks like it's at 0, it could be very close to 0 but not quite there, but I could still hear the sound clearly

quasi hound
quasi hound
rain canyon
quasi hound
#

You'd probably want to save the curve too

#

Or just all component values wholesale

rain canyon
quasi hound
#

Probably, but one one that I know of off the top of my head
Could also keep a reference to the prefab, but I don't know if it's worse to keep those prefabs in memory rather than just arrays of properties

rain canyon
abstract relic
#

is there a free audio software? i use free use youtube video sounds.

abstract relic
ember geode
#

Anyone know anyone good tutorial/guides and resources on where to start with making really nice sounds for your game? Currently need some nice footstep sounds, jumping sounds, and a dash whoosh sound.

inland raven
#

Well I do not have tutorials but all good sounds start with recording actual sounds.

#

Or using pre-built libs

ember geode
inland raven
#

Audacity is a nice one to learn

fast beacon
uneven badger
#

How would u fix the constant audio crackling (krlrklrkrlrkrlrkrkrktrkrkrkrrrtk krkrr klkkktrrt kkrrr kr krr KRR so u know what i mean) because of a lot of 3d audio sources in the scene with the same priority. They all got a custom pretty short max distance tho so idk why that should be a problem. In the profiler the audio cpu usage seems very high like 150%, idk if thats why it happens.

odd path
#

I need some tips on trimming small short sfx. currently I'm separating footsteps sound into 8, the thing is when I cut it where I think it starts and ends, the exported audio didnt produce any sound even though it sounded fine in audacity. I have to add a "what i think is empty" leeway in the beginning, and determining how big it is annoys me

#

perhaps there is a setting in Audacity for editing small audio clips so what i heard in the editor is what i will get in exported audio ?

odd path
#

alright so apparently some video player buffer for a bit at the start while playing the media. so if a media is so short it ends before the buffer finishes, it doesnt get played.
they still works fine in unity, at least in my case.

obsidian pivot
#

Hi if anyone is familiar with Wwise need some help, we're adding an RTPC to control pitch in the following code

[Header("Sound Settings")] 
    public string engineSoundID = "Speed";

    public float truckSpeed = 0;
    public float maxTruckSpeed = 100;
    
    public void UpdateSpeed(Component sender, object data)
    {
        if (data is not float speed) return;

        truckSpeed = (speed / maxTruckSpeed) * 100;
        
        Debug.Log(truckSpeed);
        AkSoundEngine.SetRTPCValue(engineSoundID, truckSpeed, gameObject);
    }```
#

we were using a single main bank and it worked properly

#

we have now switched to seperating the banks by category, so now a Vehicle Sound bank is attached to the truck where the AKAmbient components are as well, the sound plays but the RTPC no longer changes the sound and we don't know why

#

So to reiterate, the only thing we changed before it stopped working was making seperate banks and this one is dedicated to the Vehicle sounds

noble hatch
#

How do i get my audio soruce to play in the play mode? i have it to play one awake but it doesnt play in the actual play mode

formal depot
#

Does it have an AudioClip assigned to it?

noble hatch
#

If I click the speaker on the edit mode it plays but still not the play mode

hard gulch
noble hatch
#

it isnt i already checked that a couple times

hard gulch
#

Do you have an audio listener in the scene

#

And what are your audio source's settings?

formal depot
#

I recently spent like an hour trying to help someone with this and it turned out to be something really silly

#

but I don't remember what it was...

#

it might have been the game-view mute button

autumn hazel
#

Someone here knows to I can emulate N64 reverb and delay?

#

And no,I can't just download and use GameVerb.

Not only I'm broken but the dollar is high as hell in my country

urban lake
#

Hello1 Does anyone have any info on audio improvements included in Unity 6? I know they added a new way to randomize audio clips, but I was wondering if any changes on attenuation shapes and occlusion has been made.

urban lake
meager storm
meager storm
uneven badger
# meager storm Audio DSP should be something like 15% not 150% .. did you find the problem yet ...

I solved it by adding a script to all 3d audio sources that constantly checks if the player is within its max audio distance, and disabling the source if theyre too far away

Kinda feels like a weird solution tho, feels weird id have to do this and idk how much it affects my performance, i will end up with probably more than 300 audiosources... so if u got any better ones or info about this let me know

formal depot
#

Audio sources will still play even when you're past the max range (and still use a "real voice")

#

Unity supports 32 real voices by default, I believe? I know that's the number in VRChat

#

Anything past that will caues the lowest-priority, then quietest, audio source to be evirtualized

#

meaning that the audio is no longer processed, but the clip's time still increases

#

so when it becomes real again, it sounds like it was playing the whole time

formal depot
uneven badger
uneven badger
formal depot
#

That could significantly increase the amount of audio processing that's needed

uneven badger
uneven badger
formal depot
#

Are you asking if you can make it pause when virtualized?

#

Because you could certainly do that, although I don't know how you would correctly unpause it later

formal depot
uneven badger
formal depot
#

That's already roughly what happens. If every source has the same priority value, then the quietest one gets virtualized first

uneven badger
#

Shouldnt there be some in built thing for this tho cuz i feel oike this would be common

formal depot
#

It sounds like your problem is that, with 32 real voices playing, the audio system is getting overloaded

uneven badger
#

Mhm

formal depot
#

Try disabling all of your filter components and looking at the audio cpu usage

#

You should be able to find all of them in the scene by searching the hierarchy

uneven badger
#

Alright ill try that soon

formal depot
#

hm, that's annoying: there is no parent class for the audio filters

#

they're all just Behaviours

#

so you can't just search for t:audiofilter or whatever

meager storm
#

Your problem is the reverb filter on your audio source

#

Apply reverb at the audio mixer or using reverb zones

#

That will fix your problem

#

It’s possible to use reverb filter on an audio source but that breaks down at scale exactly like you are describing your original problem with a lot of short sounds

#

In project settings, there’s a bool in the audio tab that will keep filter effects on the audio source active. The default is disabled false.

#

This audio engine feature shuts down an audio source when the clip is not playing. However, this behaviour conflicts directly with adding the Reverb filter because the Reverb filter is not complete. So you get the sound of the clip cutting off.

uneven badger
#

Thank you

meager storm
#

experiment with removing that code you created to check if the audio source should play .. that's what the underlying audio system does for you in the background already .. that system is highly optimized and 'just works'

#

for now keep all your sound effects in the same priority setting in audio source .. you'll want music and other sustained 2D sounds to be a higher priority , the numbering is arbitrary .. so setting 2D and music to priority "10" works because it's higher than the default "128"

#

set to a higher number means your audio source will not be sent "virtual" once the playing voices reaches 32 which is the engine default limit

#

hope that makes sense

uneven badger
# meager storm hope that makes sense

Yeah it makes sense nice info, and i did try to remove the code and it seemed to still work, prob gonna test it again when i get home to make sure tho

viscid fjord
#

Has anyone been faced with a import error saying "Errors during import of AudioClip {path/to/file.mp3}: FSBTool ERROR: Internal error from FMOD sub-system." - my project does not use FMOD, I guess Unitys built-in importer does, and it happens every time I try to import 1 specific mp3 file, which is odd because it was exported out a DAW the same as every other mp3 file, I can load it in Audacy, play it in a browser, etc and the file itself is not corrupt, all its byte data is there, any ideas what the issue could be or how to fix it? I tried looking online which basically suggested "its a known problem and is already fixed" with many replies saying "its broken again in later versions" but the cause or solution isnt clear (as this is not a problem with any other 2K+ audio files), im using 2021.3.x LTS but I dont think the version should have an impact on this problem (as it seems to be a outlier from my investigation)

whole pewter
# viscid fjord Has anyone been faced with a import error saying "Errors during import of AudioC...
  • unity uses fmod for audio (it's their own customized (and older) version)
  • fmod itself (as in 'normal' !unity specific version) has issues decoding some mp3/mpeg files (*
  • updating unity might help, but i'd rather
  • reencode the file - use different bitrate/quality etc
  • if the file is somewhat large, split it (but IIRC in that case the error could be different one)
    (fsbtool is just editor time audio importer)

(* some mpeg files can't be properly played even w/ latest FMOD provided engine sample
it got properties of the format wrong and played it as twice as long, with 2nd part being silent; other audio players were able to play the same file normally
(i had a workaround in my asset to detect this, but it's BS heuristic to do anyway - i removed it since)

viscid fjord
formal depot
viscid fjord
dense topaz
#

Do you think this could work for some kind of castle?

meager storm
#

@viscid fjord The expected workflow is importing asset audio clips into Unity as full resolution .wav then using the import settings to compress. If you import .mp3 you're loosing a lot of quality becuse the engine will compress a second time.

whole pewter
violet mist
#

how should one approach complex runtime audio generation in an ecs/dots project? is there any guidance on interfacing between jobs and OnAudioFilterRead?

#

or is there perhaps some other means of outputting generated audio with ecs/dots than OnAudioFilterRead

violet mist
whole pewter
#

yea it's probably far from being usable yet (..still)

#

if you search forums you should be able to find github project of someone who used the whole stack in their ECS framework can't recall how it was named now

violet mist
#

i'm able to get audio playback to happen through DSPGraph but unfortunately after playing any audio through it, any code change will cause the editor's domain reload to get stuck

#

which makes it impossible to use in practice since i have to restart the editor for every code change i make

#

i'm perfectly happy to use OnAudioFilterRead as well but i don't know how to synchronize it with jobs since it's called on the "audio thread", i wonder if there's any documentation for that?

whole pewter
violet mist
#

what i'm thinking of is if there's something that lets me schedule jobs in an optimal manner wrt latency

i can of course just output things from jobs into a large enough circular buffer, read from that same buffer in OnAudioFilterRead and hope for the best, but i'd like to understand the system better

#

though i suppose if i want to really go low latency then i'll have to just bypass unity and use platform interfaces

meager storm
#

All that DOTS era audio stuff is abandoned

violet mist
#

so it seems... very unfortunate

#

the dspgraph interface seems like a very nice start

viscid fjord
# meager storm <@168578802421727232> The expected workflow is importing asset audio clips into ...

Really? Interesting, to my understanding, I had thought its best to have different formats depending on the usage in-engine because of the file type compression, where games usually use mp3 for music, and ogg/wav for sounds and voice files, I also thought the compression settings were mostly a engine advantage and get decompressed at runtime/in a build - is the standard having ALL audio files being wav regardless of how they will be used in-engine?

whole pewter
#

^ well yes if you care about quality (which might be non issue..) - when you import an audio asset unity recompresses it, depending on import setting
but note that some platform use hw decoder for some formats (iOS has AAC, possibly mp3 hw playback... ) but this should be in documentation ..

whole pewter
whole pewter
whole pewter
meager storm
#

Yes @viscid fjord it doesn't say anywhere in the docs but the standard is to add all audio files as .wav to Unity engine and use the import settings to compress

#

there is no standard compression format for sfx or music in games . the import settings are critical to understand as they affect performance at runtime

#

for example in most cases you would set music to stream

viscid fjord
# meager storm there is no standard compression format for sfx or music in games . the import s...

Interesting, I havnt noticed any performance issues but I also have pretty good specs and we havnt added all our sound files to the project yet, ill keep that in mind when we have the files to profile, from previous games ive seen, I noticed a lot of their files were in ogg or mp3, (although some of them where early 2000s era games), im guessing in other engines this is likely not a problem and they may have chose for formats out of preference?

meager storm
#

rest assured that .wav is the source and .mp3 or .ogg are compressed destination formats

#

if you choose the wrong unity import settings and you have 3000 audio clips then that's where you run into perf' issues .. really depends on the project scope

viscid fjord
#

Ah I see, thanks for the insight

terse haven
#

What's the right way to loop audio? Just checking the Loop in an audio source causes a small gap of silence to appear before the loop happens

regal needle
terse haven
#

As you said there's a short silence at the start and end, which is not there when I open the source file in audacity for example

regal needle
#

Well at least we found the problem, now we need to find a solution

terse haven
#

Do you know the solution? I don't know what to search for this

regal needle
#

No, I usually just pay people for my sounds, never had this issue.
You can check if this is a Unity issue by just playing the sound outside of unity and see if it also has the 0-bands at the end and start

terse haven
#

It does not

regal needle
# terse haven It does not

Well there doesn't seem to be some sort of Unity import setting for Audio that creates the 0-bands as far as I can see

#

Can you upload the sound here?

terse haven
#

There is a tiny fadeout at the end to minimize clicking on the loop

#

but still you don't hear the short silence when playing on loop anywhere

regal needle
#

In VLC the sound waves really do move down at the end.

#

So it seems like an Audacity export setting then.

#

Anyhow, I don't know, perhaps someone else can figure it out, but the 0 bands at the end and start are your problem, don't know how to fix.

terse haven
#

That's weird. I'll try some stuff later

sly nexus
#

Hey can someone help?, all my audio sources in my scene doesn't play/work I had this problem for a month and I couldn't solve it

formal depot
#

You don't have the Game View audio muted,d o you?

safe totem
#

my audio clip is just a bit too long for it to sound smooth (its a landing sound clip) can I somehow just remove the first few milliseconds?

formal depot
#

Use something like Audacity to edit your audio

safe totem
#

it would be so dumb, having to export multiple audio files until you get your desired length

formal depot
#

unity is not a DAW, a photo editing suite, or a 3D modeling program

#

You can certainly fade the volume out on the audio source, I guess

patent tartan
#

I dont know if it was reported, but setting time longer than audio length in audio source, gives internal error instead of standard unity error.

#

its like there is no check inside the unity code and it tries to set it (mostly likely)

#

im not sure if it can break something at runtime/in build.

sly nexus
#

so my linear rolloff is broken in my audio source which i think makes the min and max distance broken, my audio sources dont work unless i put it on costum rolloff, still my min and max distance is broken can you please help

formal depot
sly nexus
#

ok

#

its all of my audio sources in my scene btw

sly nexus
formal depot
#

This has a max distance of 2

sly nexus
formal depot
#

yes, and the max distance is 2

#

if the audio listener is more than 2 units away from the audio source, the volume will be 0

quasi hound
sly nexus
#

if i put it on like 10 or wtvr

#

so like the whole scene could here the audio

#

its snot evenplaying

#

like at all

tall oyster
#

hello, I'm trying to add a background music to my game and then a slider to control it. But when I hit play, I don't hear the music. Can you help me? I join a picture of my AudioSource. I tried to remove the output value (with wich i found that a sound was displayed), the music is good because I tried to play it inside the editor and it worked. Can you help me please

formal depot
#

start by setting the spatial blend to 0

#

this shouldn't be a sound that's coming from a specific place

#

also consider clearing the "Output" property so that it isn't going through a mixer

#

you might have a problem with the mixer in the built game

sly crystal
#

im trying to make a game where the gameplay causes the tune to evolve, anyone got any idea how to do that? lol

#

not evolve as such but add more layers etc, ive been looking at rez as an example

quasi hound
#

!collab

karmic boneBOT
#

:loudspeaker: Collaborating and Job Posting

We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
• Collaboration & Jobs

quasi hound
sly crystal
#

yes its difficult for me to even get the concept right in my head

quasi hound
#

So you'd first have some kind of midi or tracker player, then implement a system that lets the player interact with it as per your game design

#

There's quite some demand for systems like that so I'm sure whole third party assets exist for that

sly crystal
#

yeh i dont know of any, fmod sort of looks relevant

quasi hound
sly crystal
#

Thanks Spazi, u seem knowledgable about this šŸ™‚

quasi hound
meager storm
#

@sly crystal what you're talking about is called "dynamic music" there's a bunch of info out there about how it can work. It's non trivial. It requires and advanced understanding of music production and audio design for games. You can however do simple layer cross fade in unity using the mixer but you would need the music created in separate tracks as .wav

#

So a very simple version of dynamic music is possible using native Unity audio. I would not recommend looking at FMOD or Wwise unless you already have a strong foundation in audio for games. Those tools are very advanced

lone forge
#

my fault, collab would be sick but i guess i'll just focus on my own project

glacial raft
#

I feel like this is the best spot to ask this
Does anyone know what this sound effect is called (not the ticking sound) or where it comes from? I recorded this from a really old youtube video

glacial raft
#

@hard gulch THANK YOU!!! That's exactly it

grim storm
#

I have the max distance of this audio source set to 1.01 yet I can still hear the audio from across the map. How do I fix this?

quasi hound
whole pewter
#

^ the source is 2D

quasi hound
#

True that's the bigger problem

#

But still if you cut off the logarithmic curve with a low max distance, the volume at that distance will be above 0 which means it'll be played at that volume beyond the max range up to infinity

whole pewter
#

unity(fmod) will eventually virtualize the sound if it's not audible - at least it shouldn't be audible across the map, and problem seemingly solved - but it's still resources being used yes

quasi hound
#

1.01 would play it at 99% volume everywhere in the scene

whole pewter
quasi hound
whole pewter
quasi hound
#

Using a custom curve instead with a similar ramp over a shorter distance is very simple alternatively

#

I haven't seen any official report about it though

#

There's no indication it's not working as intended, it's just an easy detail to miss that the tail end of the curve starts rising up from zero as distance is decreased

whole pewter
quasi hound
whole pewter
#

yea that's what partial def. is - i.e. defined only on some domain interval - but it's not 1 function, but two in this case ( "log" + constant past 'max distance' )
somebody should bother to file report for them at least to clear up the params names 🌚

quasi hound
whole pewter
meager storm
#

that log curve behaves totally different than a custom attenuation or liner attenuation .. to see what I mean choose linear then adjust the min and max distance

#

custom curves cannot use min distance

#

it takes some experimenting to find a setting that works for your design needs

#

I use custom curves all the time because I have a different method for defining minimum size using simple colliders to define the minimum size area

quasi hound
meager storm
#

set to trigger , the audio source follows the player using the collider as the boundary , then as the player leaves the boundary audio source attenuation kicks in

olive pasture
#

I tried making a button that plays a click sound when clicked but it is not playing the sound on first click however on it works on second and later clicks. This issue remains after not clicking anything for a while. Should I optimize the audio file or use another method?
Setup:
audio listener to cam,
audio source to button itself
audioSource.Play() to button click

#

Some buttons sets game object and itself as inactive when click on which plays no sound 😦

formal depot
#

well, yes, if you turn off a game object, an audio source on it will be disabled

#

don't do that

#

Perhaps you want to use a single audio source to play all of your UI sounds

mild geyser
#

hey guys, anyone here use wwise? would you say its tough to learn? I would like to incorporate it into my project, as i havent delved too deep into audio yet. i've heard wwise is free too. thanks!

cobalt kraken
#

🫰

naive thicket
#

@cobalt kraken There's no self promotion in help channels.

pale timber
pale timber
#

No need to pay for the certs unless you really want them. Just go through the courses.

pale timber
#

You might try something like this. Might be more complicated than you need, but it's a pretty nice design like most content from git-amend.
https://www.youtube.com/watch?v=BgpqoRFCNOs&ab_channel=git-amend

Take control of the sounds in your game by pooling your Audio Sources! Reduce the number of real voices required to play a multitude of audio clips, manage their lifecycle, and enhance performance. Learn how to streamline your audio management and make your game sound fantastic with efficient audio source pooling!

Check the repository for impro...

ā–¶ Play video
fiery marsh
#

Heya, where do ya'll get gun sounds beyond unity store? Looked through the variety, but it's kinda limited, i need gun sounds that fit older guns, 1940s era

formal depot
#

That era should sound pretty similar. You've got a mixture of full-power rifles (that'll sound close to modern carbines) and submachineguns (matched by modern pistols)

#

I guess that's just the actual firing sounds, though

#

Are you looking for other sounds, like working the bolt?

fiery marsh
formal depot
#

A lot of little gun-handling sounds can be made by something other than the actual firearm

#

i've gotten good use out of the sound of me putting the paper tray back into my printer, haha

pale timber
#

I got a ton of use out of the Triune Hollywood Guns pack. It's nice that the sounds are already designed to be beefed up in case you don't want to spend a lot of time just using them as source to design a new sound.

https://www.triunedigital.com/products/hollywood-guns-sfx

Triune Digital

The Hollywood Guns SFX Bundle comes with a selection of sounds from all of our guns, processed in four massive styles! 280 EPIC sounds included!- M249- M4- Suppressed M4- AR-15- Suppressed AR-15- H&K Mp5- Remington 700 Bolt Action Sniper- Winchester 1886- Mossberg 590 Pump Action Shotgun- Barrett .50 Cal Sniper- Gl

#

And as Fen mentioned for gun handling you can make custom stuff using household items.

#

Otherwise you can look for gun Foley packs. Triune has a nice one of those as well.

https://www.triunedigital.com/products/gun-foley

Triune Digital

TheĀ Gun Foley SFX comes with all of our gun Foley sound effects! All 301 sounds are included! Includes Foley sounds for the following guns:- M249- M4- AR-15- H&K Mp5- Remington 700 Bolt Action Sniper- Winchester 1886- Mossberg 590 Pump Action Shotgun- Barrett .50 Cal Sniper- Glock- 1911 (These are the same Foley so

naive thicket
#

@pale timber Please remove referrals

pale timber
#

Huh? Like delete the links?

naive thicket
#

referral id is for kickbacks etc on asset sale

pale timber
#

Okay my bad. Thought this would be fine since the question is about gun sfx

naive thicket
#

You can edit it out from the link

pale timber
#

Ohhh gotcha

#

I just copied the URL after doing a google search

#

I will see if I can get links without referrals

formal depot
#

you usually just chop off everything after a ?

#

that's why amazon links are always 30 pages long

#

lots and lots of tracking tags for things like "how did they reach this page?"

naive thicket
#

Only the second link had one as well

pale timber
#

Fixed

#

Learning moment. Thanks

distant dune
#

did anyone here ever see a crash in UnityPlayer!FMOD::OutputWASAPI::recordUpdate+0x1ae? some of our players are having crashes and the dumps report memcpy on an invalid ptr there as the reason for them but google doesn't have any results for this and we don't have any reliable reproduction

#

(posting it here cause the place here is the unity audio engine)

whole pewter
distant dune
#

i think it's the output device

#

cause of the output

#

and unity just called the method for playing more audio record for some reason

#

and the people that have this told me they weren't doing any unplugging or anything

whole pewter
#

you can record from 'output' on windows under special circumstances if it's configured to have its loopback available for recording
but regardless if it's available then the recording should just work - so it's specific hardware in this case most likely and w/o UT being able to repro this they probably won't be able to do anythign about it...

hushed summit
#

Hey, guys! I would like to know if there is a method to actually prevent a sound effect from passing through walls and obstacles like audio absorption or something, because I have an audio source and it has 3D spatial blend.

#

Is there anyone available to give me some suggestions or whatever?

delicate rivet
#

nothing built in to unity really, 3rd party tools like steam audio has some occlusion stuff https://valvesoftware.github.io/steam-audio/doc/unity/source.html its been a while since I used it, I am not sure if you can make walls completely stop sound coming through

you could roll your own, simple thing like using Physics.Raycast, seeing if it hits an object tagged with "wall" or something before it hits the listener then turn down the volume on a source. This is pretty naive, only takes into account direct path sound. but maybe its enough to do what you want.

formal depot
#

That is roughly what I've done

#

along with using a navmesh to figure out the length of the path between the audio source and the listener

#

(I need to try out Steam Audio -- pretty sure it supports ARM now...)

spiral trail
hallow marlin
#

Anybody got a sound libary they could recommend?

#

Mainly looking for sound effects

inland raven
inland raven
hallow marlin
limber oar
#

does anyone have general advice on how to get started making music/SFX for games? im completely new to making audio in general and have a very very basic understanding of music theory. if anyone has any apps to recommend/resources to learn to get started, that would be awesome. Thanks!

pale timber
#

For example it’s fairly common to have layered music, so if you render out your music not only as a master mix but also with separated-out stems, it would make your asset pack more valuable with only a small amount of extra effort

#

Also for music, including the meter, tempo and key in the files name is nice

limber oar
#

I'm not entirely sure. I get what layered music is (mostly based on the name lol). Idk what other "common implementation approaches" would be though

pale timber
#

A simple example of layered music would be if you have a main melody/harmony layer and a percussion layer. During exploration gameplay you only play the first layer. Then the percussion layer gets faded in and out as the player enters or exits combat

#

The percussion layer then adds to emotional excitement to enhance the sense of being in combat/danger

#

While keeping the loops and transitions seamless

limber oar
#

that makes sense

pale timber
#

Otherwise you can learn a lot through YouTube for free

limber oar
#

thanks!

long owl
#

when ever i play a sound many times in a row, the bass gets randomly boosted

#

how can i fix this

hard gulch
long owl
long owl
cosmic pendant
#

is it possible to add a sound to a an output event on die in vfx graph?
You can use the otput event for sound but this can not be added to a trigger "on die" event
I have fireworks and when they die it starts the event trigger of explosion.
If i joint the output event to the fireworks trail(main event) the sound stras at the beginning.
VFX graph does not allow to join the output event to the GPU Event (trigger event)

kindred thicket
# cosmic pendant is it possible to add a sound to a an output event on die in vfx graph? You can ...

I have no idea how VFX Graph works, but I saw only one way to get callback from GPU using AsyncGPUReadback
Check this: https://youtu.be/e-hTTVr_pDI?t=426

Support development on Patreon
ā¤ļø https://patreon.com/kylebanks

Wishlist Farewell North on Steam
šŸ‘‰ https://farewell-north.com/steam

Join the Discord
šŸ‘‰ https://farewell-north.com/discord

Source Code
šŸ‘‰ https://github.com/KyleBanks/shader-pong

I love working on shaders, it's my favourite part of developing Farewell North, but there's so much m...

ā–¶ Play video
tacit spindle
#

Im pissed off… how do I get audio to not desync when using Unity recorder package with Timeline? Sound effects too near the start of the TL are playing desynced. I already set the sounds in import settings to preload

raw ridge
#

anyone know why when I press the search icon, the event option does not have a dropdown indicating my events created in fmod? i'm using the EventReference field but I cannot locate the events I created in fmod. anyone know why?

pale timber
#

This indicates that it has no data from banks to display

#

Do any errors show up in the console when you try to browse for an event?

raw ridge
pale timber
#

Okay. Note that Wwise does not support web builds

pale timber
#

I’m actually working on a package for Unity to handle a lot of the common inconveniences that I’ve run into with FMOD. Hoping to have it on the asset store in the next couple months. A big part of it is it parses the FMOD project’s xml data to auto-generate scriptableobjects for events, banks, parameters and snapshots, so you don’t need to fiddle with the EventRef browsers and use string fields for so many things

#

Makes it more similar to working with the Wwise integration

#

I’ll post it here when it’s up on the store. Hopefully people can find it helpful.

raw ridge
#

nice! I might buy it because I really like the fmod interface compared to wwise and is probably more suitable for my project

formal depot
#

mostly for my bootleg spatial audio system

pale timber
formal depot
#

The latter

#

i need to look into Steam Audio

pale timber
#

Oh nice. That was gonna be the next thing I was gonna try to tackle for FMOD/Unity

#

Kinda tricky when I imagine it though because I don’t know how to programmatically just apply things like HPF/LPF and reverb send per event instance like Wwise does under the hood

formal depot
#

I would've started with Steam Audio, but I'm pretty sure it didn't work on ARM for a while

#

but I believe it does now?

meager storm
#

@pale timber that's an extremely complex task as I am sure you are aware

#

I would caution you against that because it's better to just use the tool that already exists = Wwise. The effort required to write an effective Unity implementation for FMOD that would get similar results is not a one person job šŸ™‚

pale timber
#

Haha. I mean, I use the Wwise Spatial Audio tools all the time at work. Trying to make a similar framework for FMOD is more about personal challenge and potentially making some side money

#

But yeah I’m aware it is not an easy task

#

That’s part of what makes it exciting and interesting though

meager storm
#

Sure it's about the challenge being interesting I get it

pale timber
#

The other thing is I would like to have at least a simplified version of propagation like that for FMOD because I use FMOD for game jams since it supports web

meager storm
#

But think about how little exists in the current Unity / FMOD implementation. And also how events are instanced. You would need to do so much.

pale timber
#

That’s what got me started on making my own framework that’s led to this scriptableobject generation stuff

meager storm
#

I mean that's a really valuable and effective effort . We use scriptable objects here as well.

pale timber
#

The theory behind it doesn’t seem too complex — move the room emitter to a gate/portal and recalculate its attenuation to simulate diffraction , but yeah I’m sure it is quite a challenge, especially to do it with good performance

meager storm
#

for every sound instance

#

every game frame

#

heheh

pale timber
#

Right.

meager storm
#

Anyway yeah it seems like there a huge gap in Unity native and even in FMOD where spatial is not considered at all.

pale timber
#

Yeah it is a really premium feature to have just bundled with Wwise

#

I should look at the integration code Wwise uses :3

#

I have looked at it somewhat out of necessity on the UE side but not Unity

meager storm
#

I'm currently comparing the different spatial options from different sources and really Wwise is coming out way beyond the rest of the options

pale timber
#

And once you get used to that system it really reveals how primitive more traditional positioning is

meager storm
#

yes that's exactly my point

pale timber
#

Which is why I want that for my FMOD šŸ˜…

meager storm
#

FMOD and Unity are using tech that's 25 years old

pale timber
#

My main concern before really starting it is that doing enough ray casting to make it work will be too much of a hit to do in C#

meager storm
#

its too simple now to support how sophisticated game are looking and how much we know about acoustics etc

pale timber
#

But I’ll find out when I get there

meager storm
#

Yeah Owen I think you will find there's a reason Steam and others have aren't using C#

pale timber
#

Have you tried doing a room/portal system with native Unity audio (or FMOD) at your studio?

#

If so I’m curious to hear what sort of issues you guys may have run into so I know what to look out for

meager storm
#

Yeah we have been working on if for about 5 years in very small steps

#

We can set something up if you want just DM me

#

I'm in EST Canada

#

Owen I think we've talked on game audio slack a few times

pale timber
#

Yeah we have

#

I saw your video about grouping together audio sources. Looked pretty cool

pale timber
#

Thanks Joel

whole pewter
#

fmod uses/supports/has google resonance for full 3D
unity itself should consume google resonance properly as well as its spatialization plugin

in both cases it's just positional source, i.e. w/o 'sound materials' / geometry

pale timber
#

Yeah I’m less interested in ambisonics and ERs. It’s the geometry and propagation that I’m interested in having. Things like ambisonics and ER acoustic surfaces are cool and all but aside from VR IMO it doesn’t really have much impact on the experience. Simulation of occlusion and diffraction on the other hand does make a big difference regardless of the perspective of the listener

whole pewter
#

oh resonance has sound volumes
these are driven from C#/Update since it uses Unity physic colliders/triggers, i think this was limited to box colliders (+ it has 'room properties' i.e. different filters) that's all IIRC

jolly widget
#

are BBC sound effects good?

fresh ore
#

hey guys, I have this pouring coins sfx, but when I build and install the game on my phone, it sounds like an empty can.

#

My BGM sounds okay.

#

Do I need to change something here?

brave frigate
#

Hey everyone!

I’ve been exploring an app called Emergenyc Sirens And Horns and noticed a really cool feature that I’d love to implement in a similar app I’m working on. Specifically, I’m curious about how the manual siren mode works.

Does anyone have any insight into how this functionality is achieved? Could it be handled through a specific plugin?

I also noticed the app uses MonoBleedingEdge along with the following DLLs:

mono-2.0-bdwgc.dll
MonoPosixHelper.dll

Any guidance or pointers would be greatly appreciated! Thanks in advance.

pale timber
#

Using synthesis would probably be a better/more flexible overall implementation.

pale timber
formal depot
#

so that's a red herring

tall arch
tawny lotus
#

How do I set up a 3D audio zone in Unity so that a sound gets louder as I approach a floating plane and fades as I move away?

pale timber
#

I guess in Unity they call it ā€œVolume Rolloffā€

#

Expand the 3D Sound Settings on your AudioSource.

pale timber
# tall arch If anybody could help me with this, it'd be much appreciated šŸ™ https://discord...

Might not be exactly what you’re looking for since you specify that you’re trying to learn implementation, but still could be worth seeing what PowerUp Audio did on the FMOD side and playing around with your own audio. They released the Celeste FMOD project publicly a few years ago and you can generate your own banks and LiveUpdate connect to the game to do redesigns.

https://www.fmod.com/docs/2.00/studio/appendix-a-celeste.html

#

I haven’t really looked at it myself, but I’m guessing you need to keep the names of existing events, banks and parameters (possibly some other things like VCAs depending on how they did things) the same since those references are in the Unity project. But I imagine that aside from that you can redo the events themselves pretty much however you see fit.

pale timber
#

Otherwise I’d say just get any Unity example project or any free projects that YouTubers put onto GitHub.

#

Or do a game jam

tall arch
# pale timber Otherwise I’d say just get any Unity example project or any free projects that Y...

Thanks for the leads! I had heard of Celeste some time back but completely forgot about it... Could be a decent option.

I'll have to scavenge around the YouTubes and Reddits a bit more to find some 3D oriented projects as that's been more so my focus. I found a Unity community driven project that was discontinued called Chop-Chop which looked lovely art-wise, but will have to figure how to get it updated and running on current Unity versions.

I'd for sure love to participate in game jams but I've just always found it so daunting on how to find a team...

stuck skiff
#

Hey!

I’m experiencing an issue where the sound on my audio source is popping and glitching. However, as soon as I remove the rigidbody from the same prefab, everything works perfectly fine. Since these two things seem unrelated, this is very strange.

pale timber
#

I don’t think I’ve ever encountered that. Is the object moving? What does the ā€œpopping and glitchingā€ sound like? Could you provide a video?

stuck skiff
#

Wether it’s moving or not the issue happens, but even moving without the rigidbody fixes it

#

I’ll make a video once I get home

kindred thicket
sinful cradle
#

How to do audio and sounds? What's the good and recommended way to produce sounds like for movements and axe throwing and breaking objects in a 3D game?

hazy oxide
#

Hi, I have 360 video with four-channel audio. It's ambisonic video. What is the 2025 path to ensuring the directional video plays accurately in Unity? Google resonance is often mentioned in old 2017-19 articles. Surely there is something newer?

half sonnet
silver hornet
#

Hello all! Been trying to build the essentials project to WEBGL but having issues with audio building

Basically everything is fine with the 3d audio in the play zone but when built to webgl it goes 2d and fixed volume

I have tried using some spatializer plugins like Resonance Audio without success, also haven't found the solution online

is it a known issue? I'm using 6000.0.41f1 version for the project

versed sail
kindred thicket
kindred thicket
silver hornet
hazy oxide
hazy oxide
# kindred thicket 1st order ambisonics is a super basic format, I wouldn't worry about playback ac...

Thank you. I’m not yet knowledgeable about Ambisonic formats. If that sector of audio hasn’t changed much for a while, I’ll try Google’s Resonance plugin as well as testing Meta’s components.

My client’s original files have third order ambisonic with up to 16 channels.
In Unity I must research if I need to set those 16 up manually to multiple audio sources placed around the scene as ā€˜tracks the user can control’, or just one track pointed at one audio source, and the decoder works out what the sound should be at any vantage point. These are 360 videos so the viewing location is immovable in any case.
Clearly I have reading to do. šŸ¤“

half sonnet
balmy hawk
#

Heyho,
I've been experiencing troubles with audio synchronization in WebGL builds and now I want to include a system to show the subtitles for a dialogue, as soon as the connected audio file is loaded, how would I do that?
I only know of clip.LoadAudioData(); but that isnt like a async function that I could use in a coroutine, how would I do that?
Basically I expect to load audio data and exit a waiting loop as soon as loaded = true or smth like that.

Thanks for your help!

slender flame
#

Hi Everyone, we are using Unity and Meta XR Audio SDK and Wwise and have issues getting it to run, does anybody have experience with this? It seems like a conflict with the Meta XR Audio SDK. Thanks a lot.

heady orbit
pale timber
#

You can write your own Coroutine to check on the AudioDataLoadState.Loading value and only proceed if/when that’s false

pale timber
#

On the other hand something like Resonance or ambisonics decoding for ā€œspatial audioā€ probably is not supported for web. Can’t say for sure because I haven’t tried it.

#

Dunno why you’d really want to have that level of detail for a web build anyway. Those technologies’ best use cases currently are for VR and it’s unlikely you’d really want to be running a VR game from WebGL

spiral talon
#

Im making a game on webgl, and im facing an issue where when i try to mute a audiosource when the game is paused using the audiomixer or doing it directly it just does not work, and it has to wait until the game gets unpaused to get muted, anyone know a fix?

pale timber
#

I don’t know that for sure but for example if you used this same pause method (by actually stopping time) then you wouldn’t be able to animate something while the game is paused

#

This looks like that type of scenario

#

But hmm in that thread it sounds like it’s just the fade that was dependent on time, which would make sense. But yours is just setting a value directly.

spiral talon
pale timber
echo light
#

can i post as audio file or does it have to be unityassets

spiral talon
frank spear
#

Has anyone here messed around with Steam Audio? It's a bit confusing and I can't seem to make it work properly. + I can't find any actual tutorial, there only seems to be people showcasing their projects and the only tutorial out there is from 8 years ago and everything is now different.

whole pewter
#

audio + its interfaces haven't changed (almost literally) in 8 years

median lynx
#

im wondering why I dont have the AudioSource option in my Boolean? This is my uni assignment and its too late in the night to ask my lecturer

#

im following my lecturer's video 1 to 1

whole pewter
#

you have to assign gameobject/component in scene to the receiver, not an asset

median lynx
hazy falcon
#

Hello! I have a few questions regarding sound. If anyone has a little bit of time, it would be super nice!

I’ve just started mixing audio in Unity, and I want to understand a few basics. Is it true that your sound should never go above 0dB, or else it could cause distortion and unwanted crunching sounds?

Also, one of my problems is that when I keep my sounds at 0dB, some of them sound really low. So, should I boost them but avoid going above 0dB and use effects like a compressor or EQ filter to add more dynamics and improve the overall sound ?

pale timber
# hazy falcon Hello! I have a few questions regarding sound. If anyone has a little bit of tim...

You want the overall mix to stay below 0 dB to avoid clipping distortion (and destroying peoples’ ears). That of course means any one sound should be well below that and in order to control the mix and guarantee it won’t actually clip at the output you can have a limiter on the master mix, but generally speaking that should only be catching occasional extreme jumps in dynamics and you shouldn’t rely on it to keep your mix at an acceptable level.

#

To keep mixing simple, you should either render your sounds all normalized and then subtractively mix them in engine, or try to render them at an appropriate loudness level before importing so you only need to make minor changes in volume in engine. Up to you which is preferable.

#

Either way you standardize something to simplify the process. What you don’t want is for everything to be random and have a big mess to deal with

minor geyser
#

I'm a Japanese school student and not good at English. If you detect any unnatural phrases, please inform me of them! I want to improve my skill of both English and unity.
I want to make a music game. In this kind of games, it is really important not to delay the audio, because players will feel uncomfortable if they tap notes and effect sounds at the just same time. However, in my experiences, it have been difficult to prevend sound delay. Please teach me the way I can do it. I wonder how many music games do it. I'm sorry if my English is not good.

whole pewter
minor geyser
#

Thanks! I'll try it.

chilly fjord
#

Why did my message @ them?

#

My fault.

#

Steam doesn’t save past broadcasts it seems.

mossy jetty
#

I need to implement a system involving 10 parallel bandpass filters which are modified by the player's movement. What tools might be able to aid with this? I've been looking at FMOD but it would really difficult to have to create a set of parameters for each individual filter. I bet I could do it in RNBO or Pure Data but I'd prefer a traditional code based solution. I'd also like to avoid writing native code if possible...

raw ridge
mossy jetty
raw ridge
#

This will give you low level control over the audio system though which is a lot easier and more direct than using FMOD

mossy jetty
silver pollen
#

What is the best practice for implementing audio? Should each audio-emitting entity have its own "audio controller" script component, or should it all be centralised into an "audio manager" gameobject?
(or both)

raw ridge
proper bone
#

How do you turn all current audio off, and then play new audio.

Say a voiceline is being said, and you reach a new area, a new voice line is said.

How do I turn the old one off, so the new voiceline doesn't overlap the old one.

Thanks

raw ridge
proper bone
#

How do I do a command which stops all audio

#

@raw ridge ā¤ļø

#

This code doesn't work for me, the voices still play and overlap

#

Ignore the bracket I deleted that XD

raw ridge
pale timber
#

In most cases I’d say both. You have the audio manager handle global things while the individual things can handle their own audio behaviors

#

Basically the larger in scope the project is, the less centralized you’ll want the audio behavior to be, as with most other code.

#

The other point to remember is that any positional sound will need it’s own emitter (AudioSource), but how you handle that is up to you. A common method is have a global audio manager which can provide a prefab instance with an AudioSource. The individual behaviors then request an emitter instance and pass in the configuration they want (clip, pitch, volume, bus, etc.) and the instance gets attached to the requesting object (or placed at a specified point in the world) and either destroys when it’s done (okay) or returns to a pool (better).

pale timber
#

On the other hand if your game is simple enough that it doesn’t really benefit from positional sounds, you could do everything through the audiomanager and just have it cycle through a collection AudioSources on itself so there can be multiple voices but everything plays from one place.

tame jungle
#

What happens if I try to import FMOD to an existing project... with hundreds of audio sources?

#

Is there a way to **not **have to redo all the audiosources?

pale timber
proper bone
#

I need a way that when the charecter takes damage it plays a random voice line -

Idk the best way to ask for this except ask really nicely of anyone can call and go through it with me, and I'll show u what I got and what I wanna try and do.

I'd rlly appreciate some help and idk if this is more of #archived-code-general thing.

Please let me know

wooden hill
wooden hill
wooden hill
# proper bone I need a way that when the charecter takes damage it plays a random voice line -...

Have the random voicelines all predefined in a list or array and then just generate a random number between 0 (start index) and list/array length - 1 (since index is 0 we want to subtract the 1 to avoid an outofrange exception)

Then simply when triggering the sound to play you get that random number and get the element with index of random number from that list/array of voicelines

It should be pretty simple

proper bone
wooden hill
#

Nice

pale timber
#

But yes you potentially could pass in a lot of data

wooden hill
#

Yeah of course

pale timber
#

There’s also less obvious things like reverb send level and volume roll off

wooden hill
solar fox
#

Hey yall, I need some help regarding implementing player footstep sounds

So I'm currently going with a method that just plays a loop of a long sound clip for footsteps (which of course can be easily stopped when needed)

However I can't figure out how to make this sound good, I'm thinking i should crossfade the sounds so it goes from walking > running or vice versa more smoothly. (Currently, the sounds transition instantly, which causes some unpleasant 'pop' sound on each transition)

Implementing this crossfade though is another story, I can't figure out how to make it work for me - I'm using a soundmanager system, so I call the soundmanager functions on the object that I want to play the sounds on.

What's a good way to handle this situation? I have a soundmanager script, and a functioning audiomixer

#

I've tried looking it up, but a lot of the scripts seem to be overly complicated (and cause more issues), or it's some other kind of implementation that isn't intended for crossfading

pale timber
#

That said though with your current setup, you would want the cross-fade to be extremely short, basically just to prevent the pop. Otherwise you’ll get weird flubbing from overlapping the different loops that’ll make it sound like your player has more than two legs during the cross fade

#

It’d be better to loop via retrigger on single footsteps and select them randomly from an array, rather than running a long loop of footsteps. Then you don’t need to worry about the weirdness caused by a crossfade between different speeds. Instead just increase the trigger rate based on speed.

#

And also then you more effectively reduce sense of repetition. With running one long loop if the player runs in a straight line long enough they’ll hear the loop… unless of course it’s ridiculously long like 1 minute +

solar fox
#

And i could rework the cinemachine camera I have, as it currently works with a continuous loop of noise, simulating footsteps

Could have the same functionality in the cinemachine camera with the impulse function, thanks!

#

Just to clarify, what i mean by this is:

My current implementation, I have the camera doing a bobbing motion using a continuous noise function

  • so I thought of implementing the footstep sounds in a similar way for consistency (so looping a long sound)

But with the sound retriggers, I could make the camera also "bob" with each footstep sound effect, instead of the long loop method - which would make the camera and footsteps align easier as well

solar fox
#

Many thanks though, I'm very curious how this will turn out

tame jungle
#

does anybody know how to adjust an entire FMOD's bus's pitch via unity?

whole pewter
tame jungle
whole pewter
pale timber
tame jungle
pale timber
tame jungle
#

I mean I'm VERY new to FMOD, so I'm probably wrong lol

pale timber
#

Dunno what you’re trying to achieve but the benefit of using a parameter is it simplifies things in Unity

#

Like in FMOD you can give it a curve and interpolation without needing any math

tame jungle
#

I was using it to adjust all audio pitch to the timescale

pale timber
#

Most things in FMOD can be controlled/modulated with parameters

tame jungle
#

had to find this online lol

nimble bane
#

I'm searching for ak, m4, fn fal, pistol, knife audio files. Any idea where i can find some quality ones?

pale timber
#

Ah looks like it is suppressed. That one sounds alright then. Ideally you should have some slight variation though to avoid typewriter effect

#

Second one (unsupressed) is kinda shit

#

Sounds like a recording from inside a firing range

nimble bane
pale timber
#

That way you get a lot of variation so the sounds don’t get stale

#

In shooters the player will hear gunshots more than any other sounds in the game, so you should put in extra detail and effort on those sounds so they don’t get tiring and hopefully are satisfying

#

The typical approach (like you’ll see in those videos) is to have things layered out as:

  • Transient/body (midrange, tight, characteristic of weapon)
  • Punch (bass/sub-bass range, very tight and quick, more ā€œfeltā€ than heard)
  • Mech (sounds of mechanisms moving on the weapon when firing)
  • Tail (delayed long reflection tail following the shot, changes depending on environment)
  • Bullet/shell casings hitting the floor (changes depending on surface)
#

When the player fires a round, all of those get layered together to make one ā€œsoundā€

#

Within each layer you have several audio clip variations and also can subtly randomize pitch and volume to get even more variation

#

When you do that then the amount of variation grows exponentially, so it masks any sense of repetition

#

But for the gunshot sounds coming from enemies you can reduce the layers and detail

#

And also should change the clips being used, especially as they change distance so you can simulate the way gunshots sound very different when far away vs. close.

nimble bane
#

I'm going to work now, will watch all of it after the shift. Thanks, i send you a dm too. @pale timber

burnt thunder
#

With an Audio Source Component, if I play a oneshot clip on that audio source, does the clip that plays respect 3D Sound Settings (specifically volume rolloff based on distance)

burnt thunder
#

i did an experiement. and it seems it does.

tardy pawn
#

is there something that im missing about max distance? it seems that even when my listener is beyond the max distance, i can still hear the audio playing.

#

i tried gradually lowering the max distance value but it had no effect on the percieved volume of the audio that was playing

#

all other audio source component settings seem to work as expected, though. the only things that don't seem to be working properly are min and max distances

raw ridge
quasi hound
cedar galleon
#

"FSBTool ERROR: Encoder for chosen format is not supported on this platform."
"im having this error while trying to import a sound, please help

cedar galleon
#

I'm on 2017.1.2p3, building for the Wii U platform

cunning skiff
#

Is there any reason a car models audio file being choppy for when you give it gas? I’m not sure if it’s a script, or audio issues or what

steep raft
#

my audio isn't quite working, the audio isn't playing after i implemented the out of breath stuff, i attached the inspector and the script, can someone lmk what's wrong?

#

i have already made sure the audio sources are properly linked and have a good sound file playing

raw ridge
steep raft
raw ridge
# steep raft

I see two potential issues. you should be using one audio source for your player and use PlayOneShot instead. Play() returns one audio clip per audio source at a time

steep raft
#

oh i see

#

that fixed it šŸ‘

#

thx

heady orbit
#

https://www.youtube.com/watch?v=xu7SsP0znm4

Recently made this soundtrack for a short film contest, it's supposed to be dark, ambient, suspenseful and anxious.
Also, I wonder if the visual is the right fit for the music. I am not good at artwork. What do you think?

#dark #ambient #suspense
Dark Neighborhood Soundscape is a soundtrack I wrote for the short-film Binocular Trick created by Spencer Zimmerman and provided by Airwiggles during the Film Audio Face-off 2025: a short film audio redesign contest.

Want to watch our team's entry?
Link here: youtu.be/3subBhoWeos

Dark Neighborhood Soundscape was made...

ā–¶ Play video
pale timber
# heady orbit https://www.youtube.com/watch?v=xu7SsP0znm4 Recently made this soundtrack for a...

IMO the mini piano doesn’t work well. Makes me think of things like this:

https://youtu.be/A3tOXBx-OVg?si=KV3eJut51u04PFa7

Complete Playlist: https://www.youtube.com/playlist?list=PLjyLjyXJQJUMcgcCDT0Mrbq6pBRSIhZij

Visit our awesome Video Game Music Radio here!
https://www.youtube.com/c/ViviVGM/live

Considering to support my work? Check out my Patreon!
https://www.patreon.com/Vivi_Gaming

Leaving a like and subscribing will also help alot!

Visit our community her...

ā–¶ Play video
#

Otherwise yeah it reads as ā€œsomething bad might happen soonā€

heady orbit
pale timber
#

It’s just the (mostly) clean mini piano has a strong emotional tie to child play. Maybe the game is a horror game that somehow involves that theme and in that case it would fit fine.

heady orbit
#

Ah I see, I will think about it next time I will write music in that genre, thank you!

cunning skiff
#

Hello! I have a go kart, when I start driving it plays an engine sound but it’s very stuttery and sounds bad quality , how can I fix that?

whole pewter
# tame jungle This code worked btw: just use masterGroup.setPitch

this code is good quality, though advanced and rather invasive esp. when used as an ad-hoc solution..
you should look into how things are being done in FMOD studio/projects and be using that as OwenCooper mentioned - that is if you need to be using FMOD Studio at all for some stuff it is good at, like dynamic audio changes at runtime - otherwise Unity audio is not as capable, but it works often well (and it OOTB)

tame jungle
stuck frost
#
    public void UpdateVolume(float amount) {
        musicVolume = amount;
        musicMixer.SetFloat(StringConstants.VOLUME, Mathf.Log10(amount) * 20f);
    }   

Guys I have this function that runs for OnSceneLoaded. However, on the first scene, it doesn't change the volume of the audio mixer? Only when I change to another scene

dark atlas
cunning skiff
#

hello everyone! im trying to smooth out this audio, sometimes it is ear piercing like when trying to apply the gas again when driving it sometimes gives a loud screetch and the audio is choppy.

cedar pagoda
cunning skiff
#

thank you very much again @cedar pagoda

#

for anyone else, ive actually added in an idle and running sound and then lowered the max engine sound

#

and its phenominally better.

autumn totem
#

Guys, I need help. What would cause an AudioSource's time to get stuck at 0? The clip plays the first time, but when trying to play it again, it gets stuck at 0. I can see isPlaying becomes true, after calling Play() again, but time remains at 0 during Update() test.

#

Nevermind, I found the problem. My script was setting pitch to a defaultPitch property in OnDisable() but missing defaultPitch = pitch; in Awake().

quasi hound
#

No
The files you import should be uncompressed (or losslessly compressed) because Unity's internal formats don't support their compression methods
Any compression artifacts you introduce by compression will be preserved and take space just as much as the original clear audio

static gorge
#

i'll compose for free 🐢

viscid fjord
#

A bit of an odd question, but is there a less tedious way of handling long audio files? I have voice lines in my game where the actor recorded several takes in 1 file with a bit of "air" between some lines, so ive setup code to play at certain timestamps in the audio files, the tedious part is going through and marking each start/end timestamp for every take of every line, I was thinking I could maybe write code that will look for the "air" moments but some lines intentionally have emotional pauses in it or the actor put their own style on it where the pauses are inconsistent (but sound good) - is the only real option here to go through the tedious process of timestamping every part of these files or is there maybe some faster way I could do this?

What I mean with the "air" is for example, the first 2 waveforms on the left side of the white line are 2 different takes with "air" - and the 2 wavefroms on the other side are 1 line with a intentional pause - the long "air" in the middle is actually just air, with the other 4 smaller ones being 2 different takes with intentional pauses - so I cant think of a way I could tell code "look for air but not intentional pauses" to automate this process a bit and I dont really have any other ideas

pale timber
#

Are the ā€œseveral takesā€ literally different takes? Like different performances of the same line? Or are they different lines?

#

I guess either way, trimming these up into different assets in a DAW would probably be quicker than trying to timestamp everything. Also would be far less brittle if you decide to replace assets.

#

Like let’s say you do another VO session for Exerts. Well, your new exerts assets have totally different time stamps than the ones you painstakingly made for the previous iteration, unless you place them into the same spots in the long file

#

Whereas if you had Grizzly_Exert_01, _02, _03, etc. you can just render out the new assets and replace them and change nothing over in Unity (other than those assets being replaced)

#

Additionally then with this approach if you decide you want to exclude one of the takes, you just remove it from whatever array is storing the clips, rather than needing to know the timestamps of the particular take you want to remove

#

As for automating where to trim it, any decent audio-editing software will have a tool for doing a ā€œdynamic splitā€, where you can set parameters for the signal to detect whether or not to place a split on the audio region, so this also would remove the need for you trying to code this functionality yourself.

#

You’ll still need to manually confirm and correct the splits, but it can take care of a majority of the work.

viscid fjord
# pale timber As for automating where to trim it, any decent audio-editing software will have ...

Thanks for the detailed response - the several takes are both different performances for the same line and different lines related to the same game event (ex: "group up", "over here", "on me", and however many takes they decide to record for those 3 lines, sometimes they only do 1 or 2 takes, sometimes they might do 7+ takes)

I was considering chopping them in Audacity (as thats the only DAW I have), but I feel like it would be equally as tedious and time consuming going through the waveforms to chop, name and export each part myself - ill look into "dynamic splitting" though, maybe thatll help for this project - we are getting ready to release this month so we are kinda in "pencils down" mode, though you mentioned a lot of good points, and I think for our next project with VOs it would probably be better having them split and name each take for all their lines when they record and maybe send everything as a large zip

pale timber
#

So you could embed the markers in a DAW and then read them in Unity

quasi hound
karmic boneBOT
#

:loudspeaker: Collaborating and Job Posting

We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
• Collaboration & Jobs

quasi hound
#

Trying to play raw recordings by timeskipping sounds like a nightmare

#

It's inviting playback problems, and file storage problems since you'd be storing all the background noise between takes, not just the takes

#

Coding a system that analyzes audio does not sound like a good use of limited time, even if such a tool didn't already exist

#

But then you'd also have to code your own meta data for audio labels, and name and tweak those labels by hand using a text editor I'd assume

#

Even if Audacity didn't already have the exact kind of tools you need, designing, developing and debugging such tools would not be guaranteed to be faster than copypasting the clips out of the recordings

#

Raw recordings usually need to be mastered and cleaned up anyway, the splitting part is not the biggest timesink

pale timber
#

Yeah I’m of the same opinion that trying to make the existing timecode setup robust would take just as long or longer and would still have more cons than just splitting up the assets.

pale timber
#

Dunno about the next step of actually splitting

#

But also Audacity is to audio what MS paint is to images. You should use something better

#

Reaper has a perpetual trial license as a fully-featured and highly customizable DAW. The only downside to the trial license is seeing a pop up asking you to buy a paid license every time you start the software

#

And even a paid license is very cheap

#

I paid $60 for it once, 15 years ago, and my license is still active for the most recent versions

#

But even if you did it by hand it is still better than relying on manually-entered time codes.

heady orbit
#

https://youtu.be/nofVws6L70U

I just learned this pitchshifting technique I have overlooked (or didn't know).
Take one sound, pitchshift it, negatively in this case, and it gives you different wonderful results
It might be useful for those who didn't know as myself

#sounddesign #gameaudio
I just learned this awesome pitchshifting technique used in sound design within the Wwise 101 lesson (course).
One Sound, Pitchshifting, 5 Different Use

ā–¶ Play video
quasi hound
# pale timber From a quick search it looks like the dynamic split option in Audacity is ā€œBeat ...

It's "automatic labeling" as mentioned
Under "analysis" where you also find beat finder
"Labels" are a data track that runs parallel with an audio track and contains labels in the form of start, stop and name
You can select a part of an audio track and hit ctrl + b to create a label for that range
Using automatic labeling automatically creates a label track, which you can then modify as needed

viscid fjord
# quasi hound But then you'd also have to code your own meta data for audio labels, and name a...

Good points - at the time, this approach was the simplest for both the VOs and editing 1 file with filters sounded easier than applying filter settings to multiple files, and didnt think timestamping would be much of a roadblock, fast-forward a year later and maybe that wasnt the best idea lol - though the screenshot above is a editor I made (roughly over 2 days of work, mostly doing Editor API research), my strongest skills are in programming so I figured coding a "quick and dirty" solution might be fastest for me, but I think Audacitys "automatic labelling" approach sounds like itll be my best bet for this project with minimal manual work, so ill give that a shot - thanks again to both you and Owen for all the insight

viscid fjord
# pale timber But even if you did it by hand it is still better than relying on manually-enter...

I certainly learned a lot from working on this project and with hindsight, if I had the time to basically nuke it and start over, I totally would (theres a lot, not just time splitting, that "if I knew then what I know now", would have done things differently lol) - and thats a good comparison with Audacity, an audio engineer had told me "Audacity is for destructive audio" as in, when you apply filters, it modifies the waveform (destructively), where most DAWs treat filters like Photoshop treats layers, I just dont have the money or experience with DAWs, though I might look into Reaper, it sounds like a good suggestion

quasi hound
#

Also, even if Audacity falls short in professional use it's plenty capable
Most people don't realise how many tools it has

viscid fjord
#

It does have a lot for free, which is very nice

quasi hound
#

No
Unity cannot play typical audio file formats, they always must be decoded, then encoded into internal formats
Just the same way image formats must be converted into textures

#

What is the absolute need?

#

There may be other solutions that serve the same goal, whichever it is

quasi hound
#

I guess then it's worth a try to get the file externally
It'll still be decoded and re-encoded so you lose the compression ultimately, but you have the benefit of being able to unload them too

#

WebGL is different and awkward in a lot of ways, I don't have any technical insight on its audio

#

@stuck frost I guess it supports Resources.Load which would be simpler than WebRequests?

meager storm
#

@quasi hound is correct . You must import full resolution source files ( .aiff or .wav ) into Unity first. Then you can use the Import settings to make the asset (clip) take as little RAM as possible. See this example the compressed file is 1.6% of the original size.

#

Use this method if you are NOT streaming. With streaming you can get much higher quality because you're not loading anything up front.

#

Here's a streaming example

#

You still have to include the music in your build. As another option I'm pretty sure there are asset store solutions for streaming music in from a URL so you don't have to include it in your build.

whole pewter
#

the UnityWebRequest is for 'streaming from an URL'

whole pewter
#

but i'm not sure about its usefullness here, since it's WebGL --- might be as well as useless for this

#

compared to other asset types audio is actually rather well supported as 'external asset' at runtime, also because the mp3 spec is freely available also on standalones now, (not only on mobiles like previously...)
proper integration w/ AudioSources/Unity audio takes bit of effort - for asset preprocessing/fixed sets of AudioClips, preparation in Editor is better, for sure

quasi hound
#

In my test I can compress a 170 MB raw audio into 3.5 MB with Unity's heaviest vorbis compression
3.0 MB with quality 0 ogg in audacity
1.0 MB with 48-85 kbs mp3

#

So if there's a lot of those tracks and you need only one in memory at a time, it seems to be reasonable to import them at runtime

#

Streaming audio directly from the server that also hosts the webgl application would likely be a much better solution though

quasi hound
#

Mp3 may have a better compression ratio than that 2.06%, but it also looks like decoding it leads to some pretty bad audio artifacts
Better be a pretty bad radio for it to be worth it

pale timber
#

Also mp3 notoriously do not seamlessly loop

#

So if they’re meant to loop, then ogg should be preferred

#

In theory it sounds like you could have the files in the StreamingAssets folder, compressed externally however is needed and load them in as needed at runtime. I know I’ve done that with video on WebGL.

#

Haven’t tried it with audio clips and audio sources though

whole pewter
#

if VideoPlayer does indeed work with filesystem like StreamingAssets folder in WebGL then AudioSources will work / it's almost the same media handler of UWR and VideoPlayer needs audio decoding almost always /

kind holly
#

can unity use vsts?

whole pewter
ivory tusk
#

Getting an error on WebGL build:

Trying to get length of sound which is not loaded
#

I have preload checkbox checked in the clip properties.

#

And I play it with:

  AudioSource.clip = MyClip;
  AudioSource.Play();
#

The clip is chosen in the editor.

#

The audio plays but I think it throws on WebGL build and the function after that doesn't run.

whole pewter
kindred thicket
# pale timber Also mp3 notoriously do not seamlessly loop

It depends.
Actually seamless loop is supported in LAME Project encoder, it adds additional metadata for sample-accurate playback (MP3_ACCURATE_LENGTH, ENC_DELAY, ENC_PADDING). But other legacy decoders (non-LAME) will ignore this metadata and play with gaps as a regular MP3 file.

kindred thicket
kindred thicket
#

REAPER DAW uses a LAME codec, so it can export and import MP3 files with this metadata.

whole pewter
whole pewter
pale timber
#

I use Reaper and render mp3 with LAME. I’m pretty sure last I checked it still has the pop

kindred thicket
whole pewter
#

unity fmod is heavily embedded in engine i don't think there's a way to access its normal API easily

quasi hound
#

This server is not for self promotion
!collab

karmic boneBOT
#

:loudspeaker: Collaborating and Job Posting

We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
• Collaboration & Jobs

limpid shell
ivory tusk
#

How to properly play and wait for the audio clip to finish playing?

#

Like when it's in WebGL when I do AudioSource.Play(); clip might not even be loaded yet.

#

And if I try to check AudioSource.clip.isPlaying, it throws an error
Trying to get length of sound which is not loaded
because clip isn't even downloaded yet.
So what is the proper way of playing the sounds and waiting for it to finish?

pale timber
#

Sounds like you need a callback for when the asset is loaded, not when the AudioSource is done playing

#

How are you loading the asset?

ivory tusk
#

It's a list in a MonoBehavior:

public List<AudioClip> AudioClips;

And then I just play them by name:

    public void Play(string ClipName) {
        if(AudioClipDictionary.ContainsKey(ClipName)) {
            AudioClip AudioClip = AudioClipDictionary[ClipName];
            if(AudioClip.loadState != AudioDataLoadState.Loaded) {
                Debug.Log($"Trying to play not loaded audio clip {ClipName}");
                return;
            }
            AudioSource.clip = AudioClip;
            AudioSource.Play();
        }
        else
            Debug.Log($"Trying to play non-existing audio clip {ClipName}");
    }
#

Well I also pre-load them on Awake:

        foreach(AudioClip AudioClip in AudioClips) {
            AudioClip.LoadAudioData();
        }
pale timber
#

Add a null check to your function

#

I assume you’d get a NRE on the line checking loadState is the clip is null, but I don’t know exactly how that function works.

#

But before you check loadState, you should make sure the clip isn’t null

#

And for sanity after you confirm it’s not null you can print info about the clip retrieved

#

This is all just to make sure that you even have a clip being assigned to your AudioSource. Because your current error seems to be saying that there’s no clip

#

Also you should not name your local AudioClip variable ā€œAudioClipā€ because then it’s unclear whether you’re using static functions/properties from the class or functions/properties on the instance.

kindred thicket
#

This is example of loading local mp3-file from StreamingAssets folder

void Start()
{
    StartCoroutine(GetAndPlayAudioClip());
}
IEnumerator GetAndPlayAudioClip()
{
    var url = Application.streamingAssetsPath + "/FILENAME.mp3";
    using UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(url, AudioType.MPEG);
    yield return www.SendWebRequest();

    if (www.result == UnityWebRequest.Result.ConnectionError)
    {
        Debug.Log(www.error);
    }
    else
    {
        audioClip = DownloadHandlerAudioClip.GetContent(www);
        audioSource.clip = audioClip;
        audioSource.loop = true;
        audioSource.Play();
    }
}
kindred thicket
#

For the WebGL platform, I recommend using Vorbis(OGG) format, it is finally supported by all modern browsers, including Safari.

rich mirage
#

How does everyone handle volume levels per audio asset?
When sourcing audio from various sources it's difficult to get them to be the right levels.
Do you hard set levels from the bounce via Audacity or Logic etc? I feel like with the iterative nature of tuning levels it's not a great approach.

kindred thicket
# kindred thicket For the WebGL platform, I recommend using Vorbis(OGG) format, it is finally supp...

Unfortunately, Unity 6.x does not yet allow you to choose a compression format other than AAC, but you can use a same solution with StreamingAssets folder for Vorbis.

private AudioType audioType;

void Start()
{
    if (Application.platform == RuntimePlatform.WebGLPlayer)
        audioType = AudioType.AUDIOQUEUE;
    else
        audioType = AudioType.OGGVORBIS;
    audioSource = GetComponent<AudioSource>();
    StartCoroutine(GetAndPlayAudioClip());
}

IEnumerator GetAndPlayAudioClip()
{
    var url = Application.streamingAssetsPath + "/FILENAME.ogg";
    using UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(url, audioType);
    yield return www.SendWebRequest();

    if (www.result == UnityWebRequest.Result.ConnectionError)
    {
        Debug.Log(www.error);
    }
    else
    {
        audioSource.clip = DownloadHandlerAudioClip.GetContent(www);
        audioSource.loop = true;
        audioSource.Play();
    }
}
kindred thicket
quasi hound
#

In engine there's no limit to how much quieter you can make a sound, but you can't make it any louder than the original loudness without causing issues

#

Also better for quality to use all the available headroom

rich mirage
# quasi hound Also better for quality to use all the available headroom

From what you and @kindred thicket are describing it's both. You just said 'during authoring', but using all the headroom is best quality & mixing during runtime.

Currently I've made an SO that handles mixing levels with a simple float 0-1 and an audio clip. One of the sr devs said the 'correct' way is to master them all to be the desired levels. However we're sourcing these assets from anywhere and everywhere, and there are hundreds of them. I've come into this project relatively late and the backlog of trying to retroactively master all of these assets seems like a waste of time compared to the method I've implemented, but they absolutely need some mixing.
The other problem is it's an iterative & destructive process - reducing the volume of an audio file means there needs to be version control, saving the original full volume version incase the levels ever need to be raised again.

Also a simple normalization does not always mean equal loudness across assets, it just means the peaks are set to whatever db you normalized.

pale timber
#

This is an interesting point that I hadn’t really considered before, and I would definitely agree if implementing directly into Unity that normalized is better since you can’t easily add gain to audio assets. However I’ve heard the case made commonly from industry professionals lately at least when using middleware that it’s good practice to render assets at their intended loudness (LUFS or RMS reading, not peak) so that the amount of gain correction in middleware is minimal and the game can be closer to an appropriate mix faster because of it.

#

That is something I’ve been trying lately, as opposed to in the past just rendering at a normalized peak (e.g. -1 dB) and subtracting gain as needed in middleware. But the point about quieter assets likely having a greater amount of artifacts after conversion is one worth considering

#

In Wwise or FMOD it’s of course very easy to add gain to a signal and without any noticeable artifacting as a result, but yeah if the quieter sound is compressed and becomes more lossy than if it were rendered louder, then that gain boost will also boost those artifacts

quasi hound
rich mirage
gilded stream
#

Did anyone ever encounter a problem like this? Audio being really really choppy progressive with time at the point where I can't even hear the sound anymore

#

Also here are the project settings and audio source settings

#

Tried a lot of things but can't figure out why this happens

meager storm
#

@rich mirage Sound designer here with over 10 years experience working in Unity native audio. Also many other engines and middleware. The "best" way to do this depends on what works for you in this particular case.

Most of the time you'll want a sound description like your SO that can pass settings down the the audio source playing the clip. The down side to this is you will have to create a SO for each clip. As motioned before you cannot turn audio source up pst 0 attenuation, so there is no making a sound louder from Unity audio source. As an option you can turn mixer groups up +20.

In the example you gave where a SR dev told you "the 'correct' way is to master them all to be the desired levels" is misleading and not good advice. You cannot know how loud an asset needs to be out of context and you cannot set the volume correctly when you are creating it. There are generally accepted guidelines audio professionals use when they deliver source. That's typically done at relative levels where ambience is quiet and explosions are loud.

Because I create all my own source I typically have used that relative approach. This works fine for me because I am constantly updating the source clips as I work , changing the content or tone or volume to suit the game better.

#

There is another approach which is to send all assets into the game loud then turn them down in engine. This approach works better with Unity built in audio source priority system which in games where max voices is important is a very powerful tool.

Unity audio source priority system makes quiet sounds go virtual when max voices is reached. This system doesn't function correctly if you feed it clips set to relative levels because priority looks at the volume , attenuation and mixer group to determine "Audibility" . This is undocumented but you can see it here in the profiler

#

Basically you have to mix the game in engine becuase you cannot control the source. Your scriptable object idea is good but this means you'll need an SO for each clip .. yikes !

#

If you want to take full advantage of the priority system you'll need to batch process your audio source to hit a loud peak target. I suggest something like -3 dBuFs . There are lot's of audio batch processing tools out there.

#

The downside to this "make everything loud before you import" approach is that auditioning clips in the Unity preview is EXTREMELY LOUD

meager storm
rich mirage
# meager storm <@251462615786717184> Sound designer here with over 10 years experience working ...

Thank you for the very informative response.
To continue what you were saying about the realVoices I do have concerns about reaching that number as I'm planning on implementing an ambience biome of sorts that dynamically plays based on game state - terrain etc. Is it really as bad as some forums mention to increase that number? I wouldn't need to max it out by possibly double it (~64). Of course I wouldn't really know until I profile it - but testing only goes reveals so much until the actual systems are built.

I have editor code to automatically assign and name the AudioAsssetScriptableObjects so adding one to a folder & at one click of a button it's all assigned. This is also good for collections of sounds with slight variation like foot falls, weapon attacks, etc. Those are generally cut from the same cloth and get the same treatments as far as levels are concerned. One nice thing I just made is a shuffle for an asset collection that's static across instances, no random streaks of the same clip firing even when there are multiple of the same entity calling the same audio. Most importantly is the context that allows me to filter them to the correct channels and adds some security & convenience in the editor that a musical asset has to be assigned as a musical asset - you can't accidentally assign the wrong type, and the search box is less cluttered.

rich mirage
meager storm
#

Rather than increasing your max voices to 64 I suggest to keep it at 32 and learn to use the priority system that’s literally what’s it’s there for

#

Again it’s making voices virtual based on audibility

#

Priority system can work very well to solve the common problem of ā€œtoo many sounds are playingā€

#

Here are some tips

#
  • priority ā€˜0’ was bugged so t use that number just use 1 instead. Set only critical long loops to this high priority . Like music or other looping sounds that cannot be stopped.
#
  • use the default priority 128 for all medium priority this should be a very large group of sounds like most of your sfx
#
  • for detail sounds you want to be dropped set them to low priority like 256
#

Consider adding priority to your scriptable object.

#

Is your game 3D ?

rich mirage
rich mirage
meager storm
#

OK, so in a 2-D game my approach would be to use even less than 32 max voices. This is because you want the priority system shutting down sounds that are not important. I also recommend to increase the size of your third bucket the low priority 256 groupso less sounds are in the middle priority of 128.

#

Try 16 Max voices once you have the priorities assigned into high medium and low

rich mirage
autumn totem
#

What causes the audioSource to add a tick sound at the end of playing the sound? This doesn't happen with my other sounds, but this one in particular (which is seemingly no different as it is just another sound from the same collection of sounds I purchased).

raw ridge
autumn totem
#

Okay, I solved it. It was the wav file, because it works when I switch to a different sound. So, I edited this broken one and added a 0.0001s fade-in at the start, and 0.0001s fade-out at the end. Also changed pitch from 100 to 99.

autumn totem
#

No, it is WAV.

ornate maple
#

hi, sometimes when i switch back to the main menu of my game (separate scene) no music and sound can be heard (happens in editor and build). when loading again the scene music and sound can be heard. Any idea what might cause this? Unity 2021.3.45f1 thank you very much

raw ridge
ornate maple
raw ridge
#

Or the object that plays your audio source (if any) is destroyed

ornate maple
#

no everything is there. as said, this happens only sometime. most of the time the main main is loaded and everything work. I try to get better insights

raw ridge
#

Then i’d really check if they aren’t being disabled/destroyed/losing reference in the hierarchy. Run your game and keep testing with the hierarchy open

obsidian bramble
#

Hi, I have this sound and I'm trying my best to make it loop but I can't seem to remove that click sound every time it restarts. I really don't have any audio knowledge, does someone know a good way to easily loop sound because I can't find anything.

Also, why is it so hard to find looping audio online?? Don't all games need this kinda stuff? Like sounds that loop continuously? I want this so I can change the pitch with code.

raw ridge
obsidian bramble
#

Thanks I converted it to .wav and now the click is gone, I also happened to cut it in the right spot with another software so it loops better.

#

Sadly higher file size tho. I guess it doesn't need to be 30sec if it's looping

raw ridge
#

Yeah .wav is a lot bigger than .mp3. You should only be using it for looping audio and shorter clips

hallow marlin
#

what are some good sound libaries?

obsidian bramble
pale timber
#

MP3s notoriously have a click at the loop point.

#

You also can just import to Unity as the full quality WAV and use Unity to compress it to Vorbis (ogg).

quasi hound
quasi hound
#

Any tips for implementing stereo clips that also have distance attenuation?
It seems normally to get distance attenuation even without directionality the clip must be 3D which forces it to mono
And doing distance attenuation by controlling volume with a script feels tedious when the audio engine is already doing distance calculations and then volume variable may need to be set from multiple sources at once

meager storm
#

Spatial blend set to 3D makes a stereo source mono. You have to create your own distance attenuation for the audio source or the mixer group using parameters. Attenuation should be based on distance from listener.

#

Why would you set volume variable based on multiple sources .. that sounds backwards to me .. ??

meager storm
pale timber
#

Like, full 3D spatial blend + full spread would essentially make it have distance attenuation without positioning

meager storm
#

Spread is super weird

#

It’s hard to describe

#

Basically spread 1 inverts the clip channels

#

I might have to do a quick video explainer on it if I have time this week

meager storm
#

Actually here’s a great breakdown on spread but it doesn’t directly answer what happens with stereo source or.. but worth reading

#

Johns tutorials are great I’ve gone back to these over the years because they are so thorough

pale timber
#

Hmm interesting. I’ll have to play around with it some time.

quasi hound
meager storm
#

Ok @quasi hound I see what you mean . Sorry I don’t have an easy answer for that. I don’t write code at all. One way to approach conflicts with volume is to use a mixer group volume with parameters to do the distance attenuation then your other scripts can set volume on the audio source

kindred thicket
meager storm
#

This how I understand the engine to work as well

rich mirage
#

.ogg is vorbis and is no different than unity compressing wave to vorbis, no?

quasi hound
#

But difficult to know how or if that actually happens

#

If you import a quality 100 ogg and compress as quality 100 vorbis, the compression ratio is still like 88%
If you import a very low quality ogg and compress as very low quality vorbis, the compression ratio is above 100% so the file actually gets bigger

#

Whether that's lossy kind of double conversion or not I can't tell

#

Also, importing the super low quality ogg and compressing as very high quality vorbis will get almost the same ratio as if compressing as very low quality vorbis
So at least it's smart enough to not re-compress everything naively

kindred thicket
rich mirage
#

Vorbis does still compress .ogg files. I am seeing this >100% in some files, though it doesn't have to do with the original quality.

pulsar gull
#

whats the best way to make music for game

agile light
#

any fmod users
how do i control the speed of a clip using a parameter i looked everywhere online i cant find

meager storm
#

Do you mean pitch ? What is speed ?

agile light
#

I couldn’t find a way to control the loop

pale timber
#

You probably don’t want to loop using a loop region if that’s the behavior you want. I’ll circle back in a bit after opening up FMOD to provide you an alternative suggestion

agile light
pale timber
#

But if you were constrained to looping in FMOD, one alternative would be to use a Scatterer instrument rather than a Multi instrument. Then place a sustain point somewhere along the instrument’s region in the timeline. You actually could still use a loop region if you like how that looks more (I prefer the sustain point for something like this). It should behave the same way. You can automate the Spawn Rate with a parameter.

#

You’ll just then want to make sure to set the min/max scatter distance to the minimum value. For the min/max spawn interval you’ll want to make those the same value (unless you want some trigger rate variance) set to some value which feels appropriate. If you have it all the way at minimum you’ll be able to trigger the sound way faster than you’d ever need, so you’ll just want to find a decent value.

#

But IMO you should retrigger it in Unity rather than doing something like this. I have a placeholder MonoBehaviour that I use for looping footsteps when setting up new Unity projects with FMOD. You can just make a simple timer and have it play the event each time the timer completes, and make the interval a public value that can be controlled by the game.

#

Feel free to use

agile light
#

Wow thanks for the in-depth explanation! I’m not gonna lie it’s my first day using fmod so what you just said made almost no sense to me šŸ˜‚šŸ˜‚šŸ˜‚šŸ˜‚šŸ˜‚

#

I will do more extensive research & probably go with what you mentioned with recalling the footsteps in my scripts

#

(Actually the video you provided makes sense) and the script is pretty simple will def use!

frosty meadow
#

What is the best way to make all soundeffects (< 2 seconds) the same "loudness" ? I tried LUFS, Momentary LUFS, RMS, Peak volume in Audacity. None seem to do the job perfectly well.

pale timber
#

By ear

#

Otherwise LUFS Momentary Max is probably your best bet for automating

gray grotto
#

I'm trying to add a footstep sound to my character using a third-person controller, and I don't know why the audio plays when I walk, but then when I'm still without moving, it keeps playing. I'm using the onFootstep function in the script, and in the inspector, I've passed the MP3 audio of my footsteps, which is 1 minute long

#

In my game I'm using a general audio manager that handles background music and other sound effects like attacks, I've tried using that to add the walking sound effect by activating the sound in the move() function but the same thing happens to me

eager phoenix
#

Do you have something that stops the audio when the player stops moving?

gray grotto
#
private void OnFootstep(AnimationEvent animationEvent)

{

        if (animationEvent.animatorClipInfo.weight > 0.5f)

        {

            if (FootstepAudioClips.Length > 0)

            {

                var index = Random.Range(0, FootstepAudioClips.Length);

                AudioSource.PlayClipAtPoint(FootstepAudioClips[index], transform.TransformPoint(_controller.center), FootstepAudioVolume);
                

            }

        }

    } 
eager phoenix
#

Shouldn't be a surprise then that it keeps playing

#

Typically you wouldn't have a one minute footsteps clip, you'd have a clip of one footstep and a system that makes sure there's a delay between playing the clip

pale timber
#

The best way is to have a collection of oneshot footsteps that are randomly selected and one is played each time the event fires, and like Nitku mentioned, some way to enforce a minimum duration between sounds to prevent spamming (e.g. during animation blends).

#

If you want to use a 1 minute clip as a loop as a sort of lazy way of implementing footsteps, you do not want it to come from an animation event. You’d want to look at velocity or animation state

#

With your current script you’re constantly saying ā€œstart this one minute clip every time I take a stepā€

gray grotto
pale timber
stark lily
#

Is there another way to implement a proximity voice chat in my game rather than vivox ?

agile light
#

in FMOD I know if you want to loop a 3d sound you need a StudioEventEmitter Component but if I want to play like a button sound in 3d, cant I just add a spatializer and just Play One Shot and it works? Any downsides?

pale timber
#

The StudioEventEmitter just also holds a reference to the event instance, so that allows you to set parameters, stop, etc.

#

PlayOneShot also is technically less efficient, but not in a very substantial way. What it does under the hood is it plays an instance of the event and then immediately marks it for release once it’s done

agile light
pale timber
#

The way I like to work most of the time is to do it manually so I can have more custom control of everything, but the StudioEventEmitter component is just fine for quick setups.

agile light
#

Okay thanks!

pale timber
#

Technically you can PlayOneShot for loops but it’s not a good idea because you don’t have any (easy) way to stop it once it’s started.

grave nest
#

Am I doing something wrong, or can you not use the Audio Random Container with PlayOneShot? If so, is there any reason why?

frigid venture
#

How do I make the assessment if I want to use FMOD in my project or not?
I know nothing about FMOD beyond that many unity games use it.
I am not developing a "music game" and ive never used FMOD before, will it be overhead/overkill for a 'regular' projects needs, or is it indispensable?
I'm lacking the data to make a judgement call and dont know if I should implement it now or try to implement it later if somehow I discover my sound needs to be robust
Will it cost me financially as well? The package is free so I assume releasing a game using it isn't

I am not a sound engineer and the idea of having to do a lot of set up work in a totally separate piece of software is daunting
I think I have talked myself out of using it, the scope of what it does seems way above my project, even if my project did go commercial audio isnt really its main focus
but I feel like I cannot make that assessment because ive never done an audio heavy proj so I am torn up inside about making the right move and not fucking myself over in the long run by making the wrong choice now

pale timber
#

Middleware makes a lot of thing easier with audio. It also makes it easier if you have other people contributing who can’t code or who can’t code very much

#

You can just use native audio but if you want any more complex behaviors for the audio you will need to build them yourself

quasi hound
# frigid venture How do I make the assessment if I want to use FMOD in my project or not? I know ...

Really the only way to make the assessment with certainty is to study its features compared to unity's audio and to try it
It's very project-dependent and dev-dependent as well
Though I haven't used it, as I understand the main appeal is to reduce coding that would be required for things like dynamic audio, audio zones, layering, and to speed up audio implementation in general
Iirc it has some type of DAW included too
But if you do code and don't use a lot of audio, I think you can do fine just by what Unity gives you

#

It's not free though, similar business model to Unity where you start paying as you gain revenue

pale timber
#

FMOD licensing is very generous though

#

I think it’s free below 200k revenue

#

Need to double check that number

#

Under 600k ā€œFree or $2000ā€ I’m not sure what condition makes it 2k

#

IMO there’s way more pros than there are cons to using audio middleware, but I am biased as an audio person. But I am also a competent game programmer and still feel that way about it.

quasi hound
pale timber
#

One big thing that is often overlooked is it makes debugging audio stuff way easier

#

And optimizing per platform

quasi hound
#

I'd assume the biggest hurdle is to have to learn and deal with a whole another system, rather than anything technical

frigid venture
#

Hmm okay thats a lot to consider.
Yeah the fact there is an external FMOD studio tool I have to learn is the biggest hurdle I see right now.
Currently I don't have many sound use cases beyond playing X sound at Y location for SFX and cross-fading music tracks

quasi hound
#

If the music tracks don't have to stay synced when crossfading, it should be a very simple thing

#

Syncing is the kind of challenge I'd look for middleware for

pale timber
#

Yeah anything beyond just single music file on loop -> fade to next single music file on loop is way easier with middleware.

#

But if that’s all you need your game to do with the music and you only need simple ā€œplay this clip at this locationā€ for sounds then introducing middleware might not be worth it

#

Even then, if you want to define a custom curve for how the fade should happen, its way more of a PITA to do it with native than with middleware (where it's a built-in ready to use feature). Lots of small things like that add up.

#

But yeah ultimately you should try to define, maybe on paper, what functionality you think your game might need from the audio. IMO anything beyond just bare bones you should go with middleware. The time spent learning how to use FMOD is likely a lot less than the time you'd need to spend on cooking your own solutions for things the software already provides.

iron atlas
#

Anyone have any ideas with a c000005 virtual memory access privelidges error

#

Last in call stack is unityplayer.dll!audiomixer::getsnapshotindex(class audiomixersnapshot const &)

#

Fmod is in project

wet mist
#

what're some good ways, or the best way, to handle numerous of the same sound effect playing at the same time, or maybe very close together...causing amplified volume and a harsh sound?

pale timber
#

You need to enforce some sort of instance limiting — how you do that best is going to really depends on your needs

#

In any case you will need some condition, a way to track that condition, and a behavior for what should happen when that condition is met

#

E.g. three sounds of the same type cannot play simultaneously within a radius of 2 units of each other.

#

You could get really fancy and track how close certain sound-emitter types are together and if they’re within a certain range they share a single audio source

#

Alternatively you could use an AudioSource pool and enforce just a global limit (via the object managing the pool) where only a certain number of them with a particular clip are allowed to be used at once. Then define the limit behavior — I.e. should new ones steal old ones or should they be prevented until the old ones are done?

#

Again there’s a lot of possible ways to approach it and it’ll vary on what’s best for your project

quasi hound
#

@pale timber You have experience with audio middlewares, do you know if they have features to support those three techniques or make them easier to implement?

quartz lantern
#

FMOD and Wwise both make it very easy to limit concurrent sounds. They give you a lot of flexibility for how you want to do it too. For the other features (like pooling/clustering) you'd probably have to write the logic in Unity yourself.

pale timber
#

Yeah like Toby said, Wwise and FMOD both come with easy to use instance limiting. They do things a little differently though. FMOD only has a global limit per event, while Wwise has a global or per-object voice limit per event. The per-object limiting can be extremely useful. FMOD has a cooldown setting per event, while Wwise does not. IMO the Wwise concurrency features, like most other part of the software, scale better with larger projects than FMOD. But FMOD’s GUI is nicer to use and the software allows for a lot more creativity in how you execute things.

#

Because of FMOD’s lack of per-object concurrency limit I may try to make that a feature in an add-on/framework I’ve been developing.

lucid ermine
#

People here very likely understands audio better than me. Working on a voice chat system which is going quite well, and working on implementing "filters" to the audio, allowing you to modify it was wanted. Wanted my first filter to be a low pass filter, as I thought that'd be an "easy" task. Damn was I wrong.

I got a sound now that i like from it, and it's working mostly as intended, however, as the cutoff goes lower (effect gets more agressive) I start hearing a horrible crackling sound. I believe the audio visualization shows it as well as these sudden walls, but i'm not entirely sure what i'm doing that's causing this. Any input is much appreciated!

public override void Process(ref ArraySegment<float> samples, int frequency, float strength)
{
    float cutoff = Mathf.Max(_def.cutoff, 300f);
    int taps = Mathf.Clamp(frequency / Mathf.RoundToInt(cutoff), 1, 64);

    var buffer = samples.Array;
    int offset = samples.Offset;
    int count = samples.Count;

    for (int i = 0; i < count; i++)
    {
        float sample = buffer[offset + i];

        _history.Enqueue(sample);
        if (_history.Count > taps)
            _history.Dequeue();

        float sum = 0f;
        foreach (var s in _history)
            sum += s;
        float smoothed = sum / _history.Count;

        float mix = strength * 0.9f;
        buffer[offset + i] = sample * (1f - mix) + smoothed * mix;
    }

    AudioDebugWaveform.SetSamples(samples);
}
kindred hedge
#

Hello guys. Can someone tell me what is this technique called? I want to trim the songs that i like, to add my game. I tried to search triming the notes of a song but i couldn't find any answers.

quasi hound
kindred hedge
pale timber
#

You will need to do that manually

quasi hound
#

At least not if the sounds overlap at all

lime crater
#

Audio bug. How can I fix it?
3D Render pipeline URP
6000.0.43f1
Spacial Blend - 3D
Volume Rolloff - Linear

zinc notch
#

I'm trying to speed up a timeline that includes an audio track. I want the audio to play faster, but without increasing the pitch.
What’s the correct way to do that?

I tried routing the audio source through an audio mixer and applying a pitch shifter effect, but the output sounded really bad.

I have signal tracks that go with audio so I would like to see the waveform in timeline

pale timber
#

Ah yeah you have Doppler set to 1 so just to rule that out try setting it to 0

hard gulch
#

Could be a sample rate mismatch

unborn bolt
#

Augh..... this is deceptive.... it does NOT play on Awake() like the label says, it actually plays in OnEnable(). Why you do this to me Unity? I just wasted time assuming I couldn't replay a sound by turning an object on and off because of how they labelled this šŸ˜›

quasi hound
whole pewter
#

the label is correct
Awake is not called on disabled GameObjects (it is called on disabled component, if its GO is active though)

unborn bolt
#

Weird. How come it runs everytime an object enables too? That is not Awake behaviour

unborn bolt
whole pewter
#

not sure if weird but Awake runs when GameObject is enabled, if it was disabled at instantiation, yes

unborn bolt
#

I mean that if you toggle a GameObject's Active state from false to true, the AudioSource will play its sound, then if you toggle it to false and then true again, it plays a second time

#

from Unity's docs on Awake(): "Unity calls Awake only once during the lifetime of the script instance. A script's lifetime lasts until the Scene that contains it is unloaded"

#

So this would lead me to think that I would not be able to toggle a GameObject's Active state repeatedly in order to replay the source, yet I can

#

But their documentation for AudioSource.playOnAwake: "Enable this property to automatically play the audio source when the component or GameObject becomes active.". That's not how Awake() works though