Пример #1
0
        public void Open(Stream targetStream, int channelCount, int sampleFrequency)
        {
            this.targetStream   = targetStream;
            speexEncoder        = new SpeexEncoder(bandMode) { Quality = quality,VBR = isVbr};

            Debug.Log("FrameSize: " + speexEncoder.FrameSize);

            audioFrameBuffer = new AudioFrameBuffer(speexEncoder.FrameSize,1,WriteCore);

            if ( encodeOgg )
            {
                oggWriter = new OggSpeexWriter(GetModeAsInt(),sampleFrequency,channelCount,1,isVbr);
                oggWriter.Open(targetStream);
                oggWriter.WriteHeader("Unity3d");
            }
        }
Пример #2
0
        public void Open(Stream targetStream, int channelCount, int sampleFrequency)
        {
            this.targetStream = targetStream;
            speexEncoder      = new SpeexEncoder(bandMode)
            {
                Quality = quality, VBR = isVbr
            };

            Debug.Log("FrameSize: " + speexEncoder.FrameSize);

            audioFrameBuffer = new AudioFrameBuffer(speexEncoder.FrameSize, 1, WriteCore);

            if (encodeOgg)
            {
                oggWriter = new OggSpeexWriter(GetModeAsInt(), sampleFrequency, channelCount, 1, isVbr);
                oggWriter.Open(targetStream);
                oggWriter.WriteHeader("Unity3d");
            }
        }