Forum rules - please read before posting.

Play one shot not working after update/build

Hi,
This seems to have occurred after I updated unity and built my project... but it has been a while since I've been working on it so I'm not entirely sure. Anyway, I've been working on a new scene and the play one shot sound is not working. I then tried my previous scenes where it was working before.. but now nothing.
I've just updated AC to 1.73.8 to see if that might solve it, but no change. I'm using unity 2021.1.0a5
I've checked on the forum but not yet found a solution. My music works, so I'm not on mute, my SFX volume is turned up. I think my camera/audio listener isn't too far away from the sound, and since it was previously working in my other scenes I'm not quite sure what could have gone wrong. Any help would be much appreciated. I'll pop some screenshots of my settings in a bit.
Thanks

Comments

  • imageAudio-mixer" alt="" title="" />

  • imageAudio-settings" alt="" title="" />

  • edited July 2021

    ![](default-sound
    <a target='_blank' href=

  • Can you share a typical Action that isn't working as well, and are any relevant messages popping up in the Console?

    As you're using Mixer Groups, you should find that the Default Sound's AudioSource automatically switches its Output to the SFX mixer at runtime - is this the case?

    Since the Spatial Blend is set to 0, its distance from the camera shouldn't affect volume. So long as you've created an attention parameter for the SFX mixer named "SFXVolume", things should be working - though do bear in mind that when an alpha version of Unity, it's not unheard of for things to break unexpectedly.

    I'd recommend switching to the latest LTS version of Unity, currently 2020.3.14 - even if only in a backup/duplicate project to see if it's impacting things.

    Otherwise, it'd be worth switching the "Volume controlled by" setting to Audio Sources and clearing the Default Sound's Output property. That way, we can see if the issue itself is related to mixer groups or not.

  • Thanks for the quick response!
    Sorry, I forgot to say, no messages in the console it just proceeds on through the action as if the sound had played.

    A typical action would be a hotspot interaction where it sets a variable then plays a one shot sound then an animation. the animation plays fine (as does the rest of all my actions) but the one shot doesn't make a sound.

    I've backed up and switched to 2020.3.14. From a quick check the project survived the downgrade, but the one shot is still not playing.

    Yes the "SFXVolume" is there in the AC settings tab. Although I have just noticed under the Audio Mixer - Mixer- NewAudioMixer (Audio Listener) it says "Inactive". Is this a problem?

    I've just the "Volume controlled by" setting to Audio Sources and clearing the Default Sound's Output property, but still don't hear anything.

  • The SFXVolume needs to be listed in the Mixer Group as well.

    Although I have just noticed under the Audio Mixer - Mixer- NewAudioMixer (Audio Listener) it says "Inactive"

    That should only matter if that's the case while the game is running and the sound is playing. Unity will de-activate it automatically if "Auto Mixer Suspend" is checked.

    I've just the "Volume controlled by" setting to Audio Sources and clearing the Default Sound's Output property, but still don't hear anything.

    That would suggest the SFX volume is zero, but it sounds like you've been able to rule that out.

    Are regular SFX sounds playing? Try running a Sound: Play Action in your scene, and have it play on a new Sound object set to SFX. If that works, try the same Action but have it play on the scene's Default Sound. We'll need to see if it's an issue with the "one-shot" command.

    Please do share a screenshot of a typical Sound: Play one-shot Action, though, as I need to see the specific settings you're using. It's possible to assign an optional AudioSource - any difference if you assign the Default Sound's explicitly?

  • Thanks Chris. Super helpful as always. I'll try out the above when I get the time over the next few days and get back to you with the results.

  • OK, just got round to trying some of these out.
    Play sound worked! But only if the sound object was set to have output as Master. If the sound object is set to SFX **it doesn’t work. (just for completeness if it is on **Music – it works, if on Speech – it doesn’t). It’s the same if I have the sound object as Default Sound. (works if Default Sound output is set to master or music, but not SFX or speech).. although the text scroll sound for my dialogue works, looking at my speech settings is set to Speech Scroll Audio is: SFX. So maybe my SFX volume is fine? If I swap this to Speech as the output this works too.

    Of interest, what is the difference between an action Sound: Play, vs Sound: Play One-shot. It would be a pain to change all my action lists that were previously working but potentially one solution (if all else fails) it might be to change them all to Play: Sound.

    For the Play One-Shot on the action list, I don’t currently have a Position or Audio source assigned. I’ve tried different positions but no change. For the Audio Source there are no options to choose from here. See image:

  • what is the difference between an action Sound: Play, vs Sound: Play One-shot.

    Play will call Unity's Play function, while one-shot will call Unity's PlayOneShot function.

    The results you're reporting seem quite erratic - it's not clear where the issue lies.

    Are you able to create a fresh scene that demonstrates the issue with a single AudioClip asset called in an OnStart cutscene? If so, create a .unitypackage file including the AudioClip asset, the scene, your game's 8 Managers, and the Audio Mixer asset(s). PM it to me and I'll see if I can recreate it on my end.

    Just to double-check beforehand, though: open up the Save-file Manager near the top of the Settings Manager and check the SFX volume - is it non-zero?

  • ah, OK, so if I go to the "Manage save-game files" under the settings tab. Under "Profile 0: Properties" Music is on 0.6 but both speech and SFX are set to zero. Could this be my problem?
    Just to note the Label is Profile 1 and ID: 0 and No save game files are found.

  • That'll cause the SFX to be muted - it's behaving correctly, in that case.

    You said earlier that your SFX volume was turned on - where were you seeing this was the case? The values you set at the bottom of the Settings Manager are only the default - they don't necessarily represent the "live" values used by your game.

    You can use the Save-game Manager to clear your current profile data and revert values to their defaults.

  • Aha thank you!! :) I was looking at my audio mixers, my default options Under AC settings and my setting on the default sound to check my levels. I'm not quite sure how I must have accidentally changed the in game audio options or if they changed during my upgrade and it didn't even occur to me that the in game options would of course override the default :s . But that solved it completely! Thanks so much for your help and patience and sorry for sending you on a wild goose chase! Everything was working as it should.

    Although now when I save my project I get an error in the console "Importer(NativeFormatImporter) generated inconsistent result for asset(guid:3a35d795f47c64cd883a8951f7a6107e) "Assets/AdventureCreator/Resources/References.asset"
    and
    "Importer(NativeFormatImporter) generated inconsistent result for asset(guid:cca04defe2b8ef3448d7c24dbae11b7a) "Assets/second try/Managers/second try_SettingsManager.asset"

    But this might be completely unrelated and more due to when I moved to the LTS version. At the moment there doesn't seem to be any symptoms though.

  • No problem.

    The other errors are unrelated, and to do with Unity's asset management. So long as your game has all its Managers correctly assigned, you should be OK.

  • Thanks! Despite the long way round to the solution this has been really helpful. as it made me get round to updating AC, and the new function to "ignore current inventory" has been super useful and saved me loads of time! I hope to post an update of my game soon.
    Thanks

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.