AudioImporter.threeD Manual     Reference     Scripting  
Scripting > Editor Classes > AudioImporter
AudioImporter.threeD

var threeD : boolean

Description

Set/get the way Unity is loading the Audio data.

// Simple script that if an imported audio contains the "DL_" string
// in its filename, it sets the loadType to DecompressOnLoad.

class MyAudioPostprocessor extends AssetPostprocessor {
function OnPreprocessAudio () {
if (assetPath.Contains("DL_")) {
var audioImporter : AudioImporter = assetImporter;
audioImporter.loadType = AudioImporterLoadType.DecompressOnLoad;
}
}
}

See Also: AudioImporterLoadType Is this clip a 2D or 3D sound?

// Prints a warning if the imported audio is a 2D sound.

class Warning2D extends AssetPostprocessor {
function OnPreprocessAudio () {
var audioImporter : AudioImporter = assetImporter;
if(!audioImporter.threeD)
Debug.LogWarning(assetPath + " is not a 3D audio.");
}
}