0
#include <iostream>  
#include <assert.h>  
#include <fstream>  
#include <map>  
#include <ostream>  
#include "ogg.h"  
using namespace std;  
#pragma comment(lib,"libogg.lib")enter code hereenter
void readogg();
void readogg(){

    ifstream stream;
    ifstream file("invitation.ogg", ios::in | ios::binary);
    ogg_sync_state state;
    ogg_sync_init(&state);

    ogg_page page;
    if (ogg_sync_pageout(&state, &page) != 1)
    {
        char* buffer = ogg_sync_buffer(&state, 8092);
        assert(buffer);
        file.read(buffer, 8092);
        int bytes = stream.gcount();
        ogg_sync_wrote(&state, bytes);
    }
    ogg_stream_state s_state;
    ogg_packet pack;

    ☆ ogg_stream_pagein(&s_state, &page);
    ogg_page_packets(&page);
    ogg_stream_packetout(&s_state, &pack);
}

这是我被无形修补的代码。我有另一个关于 main 的代码,但它没有问题。我一步一步调试,所以我认为☆代码可能有错误,结果可能没有连接或保存'invitation.ogg'文件的信息。

我在任何地方都找不到答案,这是我保留此代码的最后机会。我不感谢阅读我的问题,我真的希望找到我的答案。

4

0 回答 0