2012-09-18 05:53:08 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
2012-08-29 18:07:54 +00:00
|
|
|
|
using ANX.Framework.Content.Pipeline.Audio;
|
|
|
|
|
using WaveUtils;
|
|
|
|
|
|
|
|
|
|
// This file is part of the ANX.Framework created by the
|
|
|
|
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
|
|
|
|
// For details see: http://anxframework.codeplex.com/license
|
|
|
|
|
|
|
|
|
|
namespace ANX.Framework.Content.Pipeline.Importer
|
|
|
|
|
{
|
2015-04-26 19:47:26 +02:00
|
|
|
|
[ContentImporter(new string[] { ".wav" }, DefaultProcessor = "SoundEffectProcessor", Category="Sound Files")]
|
2012-08-29 18:07:54 +00:00
|
|
|
|
public class WavImporter : ContentImporter<AudioContent>
|
|
|
|
|
{
|
|
|
|
|
public override AudioContent Import(string filename, ContentImporterContext context)
|
|
|
|
|
{
|
|
|
|
|
WaveInfo loadedData;
|
|
|
|
|
using (Stream filestream = File.OpenRead(filename))
|
|
|
|
|
loadedData = WaveFile.LoadData(filestream);
|
|
|
|
|
|
|
|
|
|
return new AudioContent(loadedData)
|
|
|
|
|
{
|
|
|
|
|
FileName = filename,
|
|
|
|
|
Identity = new ContentIdentity(filename, null, null),
|
|
|
|
|
FileType = AudioFileType.Wav,
|
|
|
|
|
};
|
|
|
|
|
}
|
2012-09-18 05:53:08 +00:00
|
|
|
|
|
2012-08-29 18:07:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|