Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SoundAssetCompiler.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 
4 using SiliconStudio.Assets.Compiler;
5 using SiliconStudio.BuildEngine;
6 using SiliconStudio.Core;
7 using SiliconStudio.Core.IO;
8 
9 namespace SiliconStudio.Paradox.Assets.Audio
10 {
11  public class SoundAssetCompiler : AssetCompilerBase<SoundAsset>
12  {
13  protected override void Compile(AssetCompilerContext context, string urlInStorage, UFile assetAbsolutePath, SoundAsset asset, AssetCompilerResult result)
14  {
15  // Get absolute path of asset source on disk
16  var assetDirectory = assetAbsolutePath.GetParent();
17  var assetSource = UPath.Combine(assetDirectory, asset.Source);
18 
19  result.BuildSteps = new ListBuildStep { new ImportStreamCommand
20  {
21  DisableCompression = asset is SoundMusicAsset, // Media player need a not compressed file on Android and iOS
22  SourcePath = assetSource,
23  Location = urlInStorage,
24  } };
25  }
26  }
27 }
Result of a compilation of assets when using IAssetCompiler.Compile
The context used when compiling an asset in a Package.
override void Compile(AssetCompilerContext context, string urlInStorage, UFile assetAbsolutePath, SoundAsset asset, AssetCompilerResult result)
Defines a normalized file path. See UPath for details. This class cannot be inherited.
Definition: UFile.cs:13