コード例 #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
ファイル: SpeexAudioEncoder.cs プロジェクト: MrBek/Poker
        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");
            }
        }