Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

alfa995

2
Posts
1
Topics
2
Followers
A member registered May 31, 2019

Recent community posts

It's all working now! I decided to go for the second method, making a class that inherits from SuperTextMesh and overriding the PlaySound function. So yeah, I had to make it virtual in the original code, plus I modified the STMSoundClipData, STMAudioClipData and STMAutoClipData to add the string attributes I needed. Figuring out the editor changes was a bit confusing at first but other than that it wasn't too hard.

Hope it's not too much trouble, making PlaySound virtual for the next update like you mentioned. Thank you so much for your help!

(1 edit)

Hi! I intend to use Master Audio for my projects and I was trying to get STM to play its sounds through it.

I looked into it and I think I figured out the general changes/additions it needs, it's actually pretty easy, but I hesitate to go in and just start changing code, especially since it'd become a hassle to redo the changes whenever there's a new update, plus I'm not familiar with the code to modify the editor and add the extra fields it needs. I was hoping to just request it as a feature and explain those changes to hopefully make it easier to implement?

Basically, you have a Master Audio object in the scene, define Sound Groups in it and to play sounds you just reference a Sound Group by name, passing it as a string argument on any of Master Audio's play sound methods. So to get it to work, all that's needed is to add some text fields to the default Audio Clip, the custom Audio Clips and Sound Clip in the editor.

  • default Audio Clip: just a string field, maybe with a [SoundGroup] attribute so the user can pick the sound from a dropdown.
  • Audio Clip: it wouldn't need an array of clips, since its own name could reference a Sound Group. Should have the same [SoundGroup] attribute too. The different sound variations would then be handled from Master Audio, by adding them to the Sound Group itself.
  • Sound Clip: instead of taking a clip for each character, it'd again take a string with the [SoundGroup] attribute.

That's for the editor side, now for the implementation side:

I think the only changes needed would be on the PlaySound method. There's no need for an Audio Source, Master Audio handles it separately and in fact they recommend removing them. There's no need to check if sounds are currently playing or allowed to be cut off, since each Sound Group has its own settings for that. Finding and assigning the clip to play based on the read character would be the same, but instead of finding a clip, it'd be a string with a Sound Group name. The pitch mode and all that would stay, but instead of modifying the pitch attribute of the audio source, it'd be stored in a variable and sent as an argument on a PlaySoundAndForget() call that replaces the audioSource.play().

I think that's about it. There might be extra stuff like a way for the user to choose whether to use this or the regular implementation but that should be the core functionality.