anx.framework/Support/WaveUtils/WaveConverter.cs
Glatzemann 99216ca254 - Fixed some bugs in build system
- Build system optimizations
- Extended ProjectConverter: DX and SharpDX assemblies are now removed from linux projects to prevent errors
- Fixed a bunch of compiler warnings
- Removed DX11MetroShaderGenerator assembly. It is now included in ANX.Framework.Content.Pipeline
- Removed HLSLParser assembly. It is now included in ANX.Framework.Content.Pipeline.
- Removed shader parser from GL3-RenderSystem. It is now included in ANX.Framework.Content.Pipeline.
- Removed RenderSystem dependencies from StockShaderCodeGenerator (sscg) tool
2015-03-15 01:12:04 +01:00

51 lines
1.1 KiB
C#

using System;
using System.IO;
// This file is part of the ANX.Framework and originally taken from
// the AC.AL OpenAL library, released under the MIT License.
// For details see: http://acal.codeplex.com/license
namespace WaveUtils
{
public class WaveConverter
{
private WaveInfo loadedData;
public WaveConverter(WaveInfo loadedData)
{
this.loadedData = loadedData;
}
public void ConvertToPcm()
{
ConvertToPcm(loadedData.Channels);
}
public void ConvertToPcm(int resultChannelCount)
{
switch (loadedData.WaveFormat)
{
case WaveFormat.ALAW:
ALaw.ConvertToPcm(loadedData, resultChannelCount);
break;
case WaveFormat.MULAW:
MuLaw.ConvertToPcm(loadedData, resultChannelCount);
break;
case WaveFormat.IEEE_FLOAT:
IEEEFloat.ConvertToPcm(loadedData, resultChannelCount);
break;
case WaveFormat.MS_ADPCM:
MsAdpcm.ConvertToPcm(loadedData);
break;
default:
throw new NotSupportedException("The WAVE format " + loadedData.WaveFormat +
" is not supported yet. Unable to load!");
}
}
}
}