How would you convert ogg files to wav files properly using C# scripting?

This is not going to be a standalone audio converter, but more so a part of a large project, and the process will be a batch conversion. Simply changing the file extension does not properly convert, as that method’s files do not work with other software. Also, I have tried NAudio and NVorbis and putting those dlls in with the other Unity plugins breaks everything. If I were to use any other library, it has to be an open/free license, nothing to purchase under any circumstance. Besides, I would much rather learn how to do this on my own without libraries. I have pulled off the batch conversion process, I just need to get the proper way of converting ogg files to wav files, so that those wave files can be used in other software without crashing.

To do it yourself you would start by finding the file format documents for both formats, then write a parser for OGG and a writer for WAV. But you should really take a look at FFMPEG which converts just about anything to anything. If it were me, I would shell-execute a compiled ffmpeg.exe with params to convert from/to. But you can get the source code for those and massage it into your project.