Browse Source

Minor FormatConverter changes.

* Removed unused channel multiplier in ToMono().
    * Changed channel multiplier in other functions to a constant.
improved_timing
Ian Burgmyer 6 years ago
parent
commit
1772dc27d2
  1. 7
      DotSDL/Audio/FormatConverter.cs

7
DotSDL/Audio/FormatConverter.cs

@ -69,7 +69,6 @@ namespace DotSDL.Audio {
/// <param name="buffer">An <see cref="AudioBuffer"/> to process.</param>
/// <param name="samples">The double array to write the converted data to.</param>
private static void ToMono(ref AudioBuffer buffer, out double[] samples) {
var ch = (int)ChannelCount.Mono;
samples = new double[buffer.Length * (int)ChannelCount.Mono];
switch(buffer.Channels) {
@ -101,7 +100,7 @@ namespace DotSDL.Audio {
/// <param name="buffer">An <see cref="AudioBuffer"/> to process.</param>
/// <param name="samples">The double array to write the converted data to</param>
private static void ToStereo(ref AudioBuffer buffer, out double[] samples) {
var ch = (int)ChannelCount.Stereo;
const int ch = (int)ChannelCount.Stereo;
samples = new double[buffer.Length * (int)ChannelCount.Stereo];
switch(buffer.Channels) {
@ -138,7 +137,7 @@ namespace DotSDL.Audio {
/// <param name="buffer">An <see cref="AudioBuffer"/> to process.</param>
/// <param name="samples">The double array to write the converted data to.</param>
private static void ToQuadraphonic(ref AudioBuffer buffer, out double[] samples) {
var ch = (int)ChannelCount.Quadraphonic;
const int ch = (int)ChannelCount.Quadraphonic;
samples = new double[buffer.Length * (int)ChannelCount.Quadraphonic];
switch(buffer.Channels) {
@ -179,7 +178,7 @@ namespace DotSDL.Audio {
/// <param name="buffer">An <see cref="AudioBuffer"/> to process.</param>
/// <param name="samples">The double array to write the converted data to.</param>
private static void ToFiveOne(ref AudioBuffer buffer, out double[] samples) {
var ch = (int)ChannelCount.FiveOne;
const int ch = (int)ChannelCount.FiveOne;
samples = new double[buffer.Length * (int)ChannelCount.FiveOne];
// TODO: Improve upmixing.

Loading…
Cancel
Save