Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

AudioImporter.forceToMono

var forceToMono: bool;
bool forceToMono;
forceToMono as bool

Description

Force this clip to mono?

	// C#: Import files containing "mono" in their name as mono.
	class DetectMono extends AssetPostprocessor {
	    function OnPreprocessAudio () {
	        if (assetPath.Contains("mono")) {
	            var audioImporter : AudioImporter = assetImporter;
	            audioImporter.forceToMono = true;
	        }
	    }
	}