خرید بک لینک

Vote count: 0

I tried to convert stereo to mono. Actually the audio file is AACObjectLC profile using two chaels.

I tried using encoder with AACHE profile with chael count but the voice is not proper.

Need some help on this.

                 MediaFormat inputFormat = audioExtractor.getTrackFormat(audioInputTrack);
                inputFormat.setInteger(MediaFormat.KEY_CHANNEL_COUNT,1);


                MediaFormat outputAudioFormat =
                        MediaFormat.createAudioFormat(
                                OUTPUT_AUDIO_MIME_TYPE, OUTPUT_AUDIO_SAMPLE_RATE_HZ,
                                OUTPUT_AUDIO_CHANNEL_COUNT);
                outputAudioFormat.setInteger(MediaFormat.KEY_BIT_RATE, OUTPUT_AUDIO_BIT_RATE);
                outputAudioFormat.setInteger(MediaFormat.KEY_AAC_PROFILE, OUTPUT_AUDIO_AAC_PROFILE);

                audioEncoder = createAudioEncoder(audioCodecInfo, outputAudioFormat);
                audioDecoder = createAudioDecoder(inputFormat);

private MediaCodec createAudioDecoder(MediaFormat inputFormat) { MediaCodec decoder =null;

        decoder = MediaCodec.createDecoderByType(getMimeTypeFor(inputFormat));


        decoder.configure(inputFormat, null, null, 0);
        decoder.start();
        retu decoder;
    }*/

private MediaCodec createAudioEncoder(MediaCodecInfo codecInfo) MediaCodec encoder =null; encoder = MediaCodec.createEncoderByType("audio/mp4a-latm"); MediaFormat format_encoder = new MediaFormat(); format_encoder.setString(MediaFormat.KEY_MIME, "audio/mp4a-latm"); format_encoder.setInteger(MediaFormat.KEY_CHANNEL_COUNT, 1); format_encoder.setInteger(MediaFormat.KEY_SAMPLE_RATE, 44100); format_encoder.setInteger(MediaFormat.KEY_BIT_RATE, 64 * 1024);//AAC-HE 64kbps format_encoder.setInteger(MediaFormat.KEY_AAC_PROFILE, MediaCodecInfo.CodecProfileLevel.AACObjectELD); encoder.configure(format_encoder, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE); encoder.start(); retu encoder; }

asked 3 mins ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 26 بهمن 1394 ساعت: 17:28

صفحه بندی