title: Using NAudio, ADTS AAC to WAV Transcoding, how to?
body: <p>I am attempting to implement the following code which I found <a href="https://stackoverflow.com/questions/13486747/convert-aac-to-wav">here</a></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Media;
  using NAudio.Wave;
  
  
  namespace AAC2WAV
  {
      class Program
      {
          static void Main(string[] args)
          {
              // create media foundation reader to read the AAC encoded file
              using (MediaFoundationReader reader = new MediaFoundationReader(args[0]))
              // resample the file to PCM with same sample rate, channels and bits per sample
              using (ResamplerDmoStream resampledReader = new ResamplerDmoStream(reader,
                  new WaveFormat(reader.WaveFormat.SampleRate, reader.WaveFormat.BitsPerSample, reader.WaveFormat.Channels)))
              // create WAVe file
              using (WaveFileWriter waveWriter = new WaveFileWriter(args[1], resampledReader.WaveFormat))
              {
                  // copy samples
                  resampledReader.CopyTo(waveWriter);
              }
  
          }
      }
  }
  </code></pre>
  
  <p>Input file is *.aac (args[0]) output file should be *.wav (args[ 1 ]).
  I am running the complied code as a console application and I get no errors, however it just seems to hang once it creates the wav file with 0 KB size</p>
  
  <p>I'm wondering is there there is something I am missing or perhaps something I need to further understand. </p>
  
  <p>Windows is reporting the *.aac files as ADTS.</p>
  
  <p>Perhaps it is that I need to extract and rewrite the header, but I am not familiar with AAC at all so would seek some guidance on that aspect if deemed necessary.</p>
  
  <p>When I try to open the file with WMP it says it cannot connect to the server <em>(suggests codec issue)</em>, however I can convert it with FFMPEG to a wav file without any trouble. Using FFMPEG is not ideal for the particular implementation I am looking at. </p>
  
  <p>Any assistance would be greatly appreciated.</p>
  
  <hr>
  
  <p><strong>Info on the actual file:</strong></p>
  
  <pre><code>General 
  Complete name : C:\Users\....\AAC2WAV\bin\Debug\0cc409aa-f66c-457a-ac10-6286509ec409.aac 
  Format : ADIF 
  Format/Info : Audio Data Interchange Format 
  File size : 180 KiB 
  Overall bit rate mode : Constant 
  
  Audio 
  Format : AAC 
  Format/Info : Advanced Audio Codec 
  Format profile : Main 
  Bit rate mode : Constant 
  Channel(s) : 14 channels 
  Channel positions : , Back: 14 
  Sampling rate : 96.0 kHz 
  Frame rate : 93.750 FPS (1024 spf) 
  Compression mode : Lossy 
  Stream size : 180 KiB (100%) 
  </code></pre>
  
  <p>Information gathered from file using: <a href="http://mediaarea.net/en/MediaInfo" rel="nofollow noreferrer">MediaInfo</a></p>
  
  <p>I should add here that the lower section of the above info is incorrect I believe.
  The sample rate is not 96k it is 22050 and there is only 1 channel</p>