Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 意外的结局;需要元数据_C#_Audio_Windows Phone 8_Flacbox - Fatal编程技术网

C# 意外的结局;需要元数据

C# 意外的结局;需要元数据,c#,audio,windows-phone-8,flacbox,C#,Audio,Windows Phone 8,Flacbox,我正在尝试在windows phone中制作一个应用程序,它可以进行音频隐写。为此,我将FLAC流转换为WAV流,以便可以轻松地更改数据字节 我将FlacBox编译为WP类库,并删除了[Serializable],因为idk需要更改它 public List<byte> ReadToEnd(System.IO.Stream streams) { using (WaveOverFlacStream wav = new WaveOverFlacStream(new FlacRea

我正在尝试在windows phone中制作一个应用程序,它可以进行音频隐写。为此,我将FLAC流转换为WAV流,以便可以轻松地更改数据字节

我将FlacBox编译为WP类库,并删除了
[Serializable]
,因为idk需要更改它

public List<byte> ReadToEnd(System.IO.Stream streams)
{
    using (WaveOverFlacStream wav = new WaveOverFlacStream(new FlacReader(streams, false)))
    {
        try
        {
            long originalPosition = 0;

            if (wav.CanSeek)
            {
                originalPosition = wav.Position;
                wav.Position = 0;
            }

            try
            {
                byte[] readBuffer = new byte[4096];

                int totalBytesRead = 0, bytesRead;
                if (wav.CanRead)
                    while ((bytesRead = wav.Read(readBuffer, totalBytesRead, readBuffer.Length - totalBytesRead)) > 0)
                    {// never pass this
                        totalBytesRead += bytesRead;

                        if (totalBytesRead == readBuffer.Length)
                        {
                            ...
public List ReadToEnd(System.IO.streams)
{
使用(WaveOvervacStream wav=新的WaveOvervacStream(新FlacReader(streams,false)))
{
尝试
{
长原始位置=0;
if(wav.CanSeek)
{
原始位置=波形位置;
波位置=0;
}
尝试
{
字节[]读缓冲区=新字节[4096];
int totalBytesRead=0,字节读取;
if(wav.CanRead)
而((bytesRead=wav.Read(readBuffer,totalBytesRead,readBuffer.Length-totalBytesRead))>0)
{//永远不要通过这个
totalBytesRead+=字节读取;
if(totalBytesRead==readBuffer.Length)
{
...
wav仅返回19MB中的44个字节

82,73,70,70,20,9,49,1,87,65,86,69102109116,32,16,0,0,0,1,0,2,0,68172,0,0,16177,2,0,4,0,16,0100,97116,97240,8,49,1

我把这些字节转换成ASCII,得到了RIFF/WAVE头,但我仍然没有音频数据。我缺少什么


编辑:我使用
[DataContract]
来更改
[Serializable]
,但仍然存在错误。

如果我从音频文件中读取所有字节,然后使用
内存流
将这些字节读取为
IO.Stream
然后使用
FlacReader
waveOvervacStream