2014-07-08 3 views
0

SoXR 라이브러리의 가변 속도 기능을 사용하여 실시간으로 오디오 스트림의 샘플링 속도를 동적으로 변경합니다. 불행히도 나는 사인파로 테스트 할 때 1.0에서 더 큰 값 (예 : 1.01)으로 속도를 변경할 때 원하지 않는 클릭 노이즈가 있음을 발견했습니다. 1.0보다 큰 값에서 1.0으로 변경할 때 원하지 않는 인공물을 발견하지 못했습니다. 나는 그것이 생산하고 있던 웨이브 폼을 보았고, 속도 변화시 약간의 샘플이 잘못 옮겨지는 것처럼 보였다.SoXR 라이브러리를 사용하여 가변 속도 리샘플링을 할 때 원치 않는 클릭

여기에 서명 16 비트 인터리브 샘플을 사용하여 저장 스테레오 440Hz로 사인파의 예의 사진입니다 :

http://i.imgur.com/KTpPJSl.png

가 나는 또한 다섯 번째 코드 예제 넘어 가변 속도 기능을 포함하는 모든 문서를 찾을 수 없습니다. 다음은 초기화 코드입니다.

bool DynamicRateAudioFrameQueue::intialize(uint32_t sampleRate, uint32_t numChannels) 
{ 
    mSampleRate = sampleRate; 
    mNumChannels = numChannels; 
    mRate = 1.0; 
    mGlideTimeInMs = 0; 

    // Intialize buffer 
    size_t intialBufferSize = 100 * sampleRate * numChannels/1000; // 100 ms 
    pFifoSampleBuffer = new FiFoBuffer<int16_t>(intialBufferSize); 

    soxr_error_t error; 

    // Use signed int16 with interleaved channels 
    soxr_io_spec_t ioSpec = soxr_io_spec(SOXR_INT16_I, SOXR_INT16_I); 

    // "When creating a var-rate resampler, q_spec must be set as follows:" - example code 
    // Using SOXR_VR makes sense, but I'm not sure if the quality can be altered when using var-rate 
    soxr_quality_spec_t qualitySpec = soxr_quality_spec(SOXR_HQ, SOXR_VR); 


    // Using the var-rate io-spec is undocumented beyond a single code example which states 
    // "The ratio of the given input rate and ouput rates must equate to the 
    // maximum I/O ratio that will be used: " 
    // My tests show this is not true 
    double inRate = 1.0; 
    double outRate = 1.0; 

    mSoxrHandle = soxr_create(inRate, outRate, mNumChannels, &error, &ioSpec, &qualitySpec, NULL); 

    if (error == 0) // soxr_error_t == 0; no error 
    { 
     mIntialized = true; 
     return true; 
    } 
    else 
    { 
     return false; 
    } 

} 

어떤 일이 일어날 수 있습니다. 또는 실시간으로 가변 비율 오디오 리샘플링이 가능한 대체 라이브러리에 대한 제안이 있습니까?

답변

1

SoXR 라이브러리 개발자와 이야기 한 후 soxr_create 메서드 호출에서 최대 비율 매개 변수를 조정하여이 문제를 해결할 수있었습니다. 개발자의 응답은 here입니다.