Hello Guest

Author Topic: Audio Volume  (Read 4649 times)

habitoti

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
    • Rombos Homepage
Audio Volume
« on: October 20, 2013, 09:53:31 am »
Hi,

I found that click sounds that I attach to UI buttons have a very low volume only. Of course I can start to play with the global listener volume or the source volume, but thinking about it I just wondered: do orthographic cameras have an impact on the listener volume? I.e.: if I have high res graphics and a lower res device (so that the camera is logically farther away), does that change the overal volume then, because the audio source are more distant to the listener? Or is that all completely irrelevant? Sorry if this is a no brainer, I am just starting to connect the dots...

Thanks, habitoti
Checkout our homepage or visit the Rombos blog.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Audio Volume
« Reply #1 on: October 20, 2013, 11:32:29 am »
There is only one audio source - attached to the tk2dUIAudioManager script. The audio clip is 2D, so it shouldn't be dependent on your camera. If you decide to replace the clips, be sure to untick "3D sound" on it.

habitoti

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
    • Rombos Homepage
Re: Audio Volume
« Reply #2 on: October 20, 2013, 11:41:08 am »
Excellent...that was exactly the issue. Turning 3D off makes it sound as it should (too bad that can't be done as a mass operation :-/ -- I have a lot of audio pieces...)

Thanks, habitoti
Checkout our homepage or visit the Rombos blog.

XpandeR

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Audio Volume
« Reply #3 on: October 20, 2013, 09:10:31 pm »
Quote
(too bad that can't be done as a mass operation :-/ -- I have a lot of audio pieces...)

You can do this for all sounds by implementing custom import preprocessor. Once this is done, you can reimport all existing audio. For new files, it will be set by default.

Something like this (save as ImportPreProcessor.cs and put into folder called Editor):

Code: [Select]
public class ImportPreProcessor : AssetPostprocessor
{
    private void OnPreprocessAudio()
    {
        var audioImporter = (AudioImporter)assetImporter;
        audioImporter.threeD = false;
    }
}

habitoti

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
    • Rombos Homepage
Re: Audio Volume
« Reply #4 on: October 20, 2013, 09:20:46 pm »
Excellent tip, 1k thanks!!
Checkout our homepage or visit the Rombos blog.