Hi,
  From looking at a few places, mplayer & xine. I see that
0x2000 type for audio is ac3 in avi. I am having problems
with the API in getting an ac3 file to mux with a video 
stream.

Basically I am doing something like this;

     
InputAC3Stream.open(InputAC3Filename.c_str());

const int rate = 48000;
const int channels = 5;
            
WAVEFORMATEX fmt;
memset(&fmt, 0, sizeof(WAVEFORMATEX));
fmt.wFormatTag = 0x2000;
fmt.nChannels = channels;
fmt.nSamplesPerSec = rate;
fmt.nAvgBytesPerSec = rate * channels;
fmt.nBlockAlign = channels;
fmt.wBitsPerSample = 16;
fmt.cbSize = sizeof(WAVEFORMATEX);
                
OutputAStream = OutputStream->AddStream(
  AviStream::Audio, (char*)&fmt, sizeof(WAVEFORMATEX),
  fmt.wFormatTag, fmt.nAvgBytesPerSec, fmt.nBlockAlign);

double tmp = (channels * rate * 1.0)/ VideoFrameRate;
AudioToReadPerFrame = (long)(tmp);
AudioBuffer = new  (unsigned char)[ AudioToReadPerFrame ];


then per frame I do;

                ExposeFrame();

                if( AudioBuffer && InputAC3Stream )
                {
                    InputAC3Stream.read( AudioBuffer, AudioToReadPerFrame );
                    OutputAStream->AddChunk(
                        (const char*) AudioBuffer,
                        (unsigned int)InputAC3Stream.gcount(), 0 );
                }

though xine really doesn't like the final file and no ac3.

Any thoughts ?

-- 
---------------------------------------------------
It's the question, http://witme.sourceforge.net
If you think education is expensive, try ignorance.
                -- Derek Bok, president of Harvard


_______________________________________________
Avifile mailing list
[EMAIL PROTECTED]
http://prak.org/mailman/listinfo/avifile

Reply via email to