I have engine sounds that are not playing on the Nexus 7. They play fine in the editor and on a Nook Color. I have tried MP3s, OGG, and Wav. It’s strange that a music MP3 plays fine in the project across all devices but these particular sounds do not.
Here is the main part of my engine sounds script:
for (int i = sounds.Length - 1; i >= 0; i--)
{
if (rpm > sounds[i].rpm)
{
currentDiff = rpm - sounds[i].rpm;
soundsDiff = sounds[i].Difference(sounds[i + 1]);
highRatioVolume = volumeCurve.Evaluate(Math.Abs((currentDiff) / (soundsDiff)));
lowRatioVolume = 1 - highRatioVolume;
lowRatioPitch = pitchCurve.Evaluate(currentDiff / sounds[0].rpm) * pitchMultiplier;
highRatioPitch = pitchCurve.Evaluate(currentDiff / sounds[0].rpm) * pitchMultiplier;
low = sounds[i];
high = sounds[i + 1];
if (!lowerLoad.clip.Equals(sounds[i].clip))
{
lowerLoad.clip = sounds[i].clip;
lowerLoad.Play();
}
if (!higherLoad.clip.Equals(sounds[i + 1].clip))
{
higherLoad.clip = sounds[i + 1].clip;
higherLoad.Play();
}
break;
}
}
It evaluates the current rpm and then assigns the correct sound clips to the AudioSources (higherLoad, lowerLoad). I’m not sure where to turn here as I’ve tried everything I can thing of.
My other Nexus 7 related issue is that the projector shadow I get using the CharacterShadow script is not showing. My guess is the RenderTexture is not formatted correctly or maybe the shader scripts are not compatible with the Tegra. Again, this works fine on a Nook Color and in the editor.
Here are the shader scripts from CharacterShadow.cs:
private static string shadowMatString =
@"Shader ""Hidden/ShadowMat"" {
Properties {
_Color (""Color"", Color) = (0,0,0,0)
}
SubShader {
Pass {
ZTest Greater Cull Off ZWrite Off
Color [_Color]
SetTexture [_Dummy] { combine primary }
}
}
Fallback off
}";
private static string projectorMatString =
@" Shader ""Hidden/ShadowProjectorMultiply"" {
Properties {
_ShadowTex (""Cookie"", 2D) = ""white"" { TexGen ObjectLinear }
_FalloffTex (""FallOff"", 2D) = ""white"" { TexGen ObjectLinear }
}
Subshader {
Pass {
ZWrite off
Offset -1, -1
Fog { Color (1, 1, 1) }
AlphaTest Greater 0
ColorMask RGB
Blend DstColor Zero
SetTexture [_ShadowTex] {
combine texture, ONE - texture
Matrix [_Projector]
}
SetTexture [_FalloffTex] {
constantColor (1,1,1,0)
combine previous lerp (texture) constant
Matrix [_ProjectorClip]
}
}
}
}";
I did quite a lot of Googling and forum searching for this problem with no luck.
Thanks.