k, just trying to get my head round some of the finer details of the audio, and wanted to clarify the correct values I should be using for the various properties for volume
1st in the project settings/audio/audio manager is the volume value supposed to be a float between 0 1? or some arbitrary figure I decide?
2nd
when setting the AudioListener.volume value via a script it seems that there is only really a dicernable difference for float values below .5 or .6 again what are the appropriate values I should be using here.
I am about to go through all my audio make sure they’re all roughly the same volume level externally as I seem to get various levels across the board, so it may be down to that. However my confusion has stemmed from trying to maintain volumes using a main volume slider.
Also a little iphone specific here, I wanted to ask ppl if they’d noticed any problems trying to maintain consistancy across device types., Obviously Ipod 1G is dependant on headphones/external speakers, and so I am assuming that due to the hardware involved with the various platforms we’re not going to hit a 1 size fits all scenario.
Yes. Values outside 0-1 mean nothing. (In Unity, you can’t boost audio levels from what they were recorded at, and you can’t alter the phase of audio, so only a fraction between zero and one makes sense.) This is also the case for AudioListener.volume and AudioSource.volume. I would recommend leaving the Audio Manager setting at 1 and script the other values as necessary.
That’s because Unity uses a linear taper, which does not correspond with human hearing. The first graph below shows the rough contour of human perception of amplitude versus loudness, versus the linear amplitude = volume curve that Unity uses. The second graph shows the derivates of these two equations. You can see that right around the range you are talking about, Unity begins to make less of a difference than it should. (And below that range, it makes a larger difference than it should.)
Whatever sounds good. You can use my script if you want to make the numbers make intuitive sense.
Don’t do that - it’s a waste of your time. It’s good practice to make sure that your audio files are as loud as possible before distorting, but it’s basically impossible to “match volume” between different audio files.
There is no way to match volume level across devices. The iPod touch speaker will distort loud audio - its amplifier is underpowered. The quieter a sound plays, the less bass and treble it seems to have. There are several variables, and none are worth fretting over. Just make your audio sounds good and loud, and make sure that you provide a control, for people with the touch 1G. You can always turn the loud sounds down, but on these little devices, you can’t rely on being able to turn the quiet ones up.
OK, so I’m digging this one up again.
I’ve tried your script (or at least the portion that counts to work on the figures) and it still seems that the audio listener isn’t quite right, ie its either OFF (listener.vol = 0) or on (anthing more than 0 including .0001)
but its not really the gui
its the audio listener its just by virtue of the easy of use that I’m using the gui to control the listener volume.
I’m checking the values that I’m setting the listener to and they’re all FP’s between 0 1
Well, I’m pretty tired, so if you could, please send a bug with a .unitypackage that contains an audio file and a script that does something like the following, and make sure it doesn’t do anything on the device, but does in the Editor:
listener.volume = Mathf.Sin(Time.time) * .5 + .5;
Let us know if you submit. Otherwise, I’ll get to it after I wake up.
Oh WHOOOPS,
Sorry for wasting ur time, I just checked and it looks like its an OS4 - unity issue.
testing my app on an os3.x iphone and it works fine.
should I flag this to unity or apple ?
You would likely report a bug on the unity side so they are at least aware of it. I doubt they will waste too much time on it as long as its not the OS 4 RC version, especially as OS4 will find much less users than previous OS versions as 1st generation is totally cut and for 2nd generation its discussable if it is worth it (I don’t intend to upgrade as multitasking is cut I don’t have a reason to further service trash my iphone at least until a killer app is out that makes me change my mind)