将byte []写为mp3文件

Mav*_*ven 2 .net c# mp3

这就是我正在做的事情,我读了一个.mp3文件将其转换成Base64String这样:

using (fileStream)
                    {

                        fileStreamLength = (int)fileStream.Length + 1;
                        fileInBytes = new byte[fileStreamLength];
                        int currbyte = 0, i = 0;

                        while (currbyte != -1)
                        {
                            currbyte = fileStream.ReadByte();
                            fileInBytes[i++] = (byte)currbyte;
                        }

                    }

                    string fileInString = Convert.ToBase64String(fileInBytes);
Run Code Online (Sandbox Code Playgroud)

现在经过一些工作,我再次有相同的Base64String,我将转换成字节通过byte[] asBytesAgain = Convert.FromBase64String(fileInString);

现在我的问题我怎么能把它byte[]写成一个.mp3要播放的文件?

Lor*_*ler 7

File.WriteAllBytes("somefile.mp3", asBytesAgain);
Run Code Online (Sandbox Code Playgroud)