title: Convert Opus (.ogg) to PCM (.wav) in .NET
body: <p>I have a file .ogg and i need to convert it to .wav. I'm tryng to use <a href="https://github.com/DevJohnC/Opus.NET" rel="nofollow noreferrer">Opus.Net</a> (that use NAudio) but i get this exception in OpusDecoder.Decode(): </p>
  
  <blockquote>
    <p>"System.Exception: 'Decoding failed - InvalidPacket'"</p>
  </blockquote>
  
  <p>This is the code:</p>
  
  <pre><code>byte[] audioBynary = File.ReadAllBytes($"{filePath}{fileOgg}");
  
  _decoder = OpusDecoder.Create(48000, 1);
  var pcmBinary = _decoder.Decode(audioBynary, audioBynary.Length, out int decodedLenght);
  
  WaveFileWriter.CreateWaveFile($"{filePath}{fileWav}", new WaveFileReader(new MemoryStream(pcmBinary)));
  </code></pre>