문제

I have a need to convert audio samples from 11025 and 22050 to 44100; I'm looking for the fastest and best sounding conversion routine. I require that the answer be given in pure Java, without the need for external routines or libraries. The source is an array of short values representing left and right channels, interleaved like so LRLRLRLR
I've heard that gaussian transformation is the best, but it is a cpu killer.

Update
To add more detail, I would like a mix between best and fastest. The answer would give great sounding audio suitable for near real-time communication.
Update 2
I'm looking for some short code examples for this one, should be ez points for you audio guru's

도움이 되었습니까?

해결책

you can (ultimately) just use a fir after filling every other sample with 0s - you're upsampling by 2 or 4. this will be plenty fast for realtime. audio quality will be fine for most applications.

다른 팁

Well, it is hard to resample it slow enough so that it is not realtime :-) One of the best & still fast solutions is to do forward FFT, and then do reverse FFT with any sample rate you need.

You may implement this on your own, or copy & paste any FFT implementation.

This might work like 100x realtime or faster, not sure you need 1000x faster (in this case you can go for linear or bicubic interpolation) :-)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top