PDA

View Full Version : needs help with SSRC


Haaan
8th March 2004, 02:14
Hey, i'm writing a AC3 encoder filter to output 6 PCM channels on a SPDIF output.

Now I am including an option to resample 48Khz (for 44.1Khz or lower input) because it's compatible with all dolby digital decoders.

The problem is the result sounds crappy (even when I'm doing a 48Khz -> 48Khz "conversion").

Here is some of the usefull code


m_pReSampler = SSRC_create(m_wfxInput.nSamplesPerSec, m_nReSamplerSamplingRate,
m_wfxInput.wBitsPerSample, 16, m_wfxInput.nChannels, 1, 1, 0, 0);


HRESULT CDolbyOutFilter::Receive(IMediaSample *pIn)
{
...
m_pReSampler->Write(pbyInputBuffer, lInputBufferSize);

for ( ; ; )
{
unsigned int nSize;
m_pbyReceiveBuffer = (BYTE *)m_pReSampler->GetBuffer(&nSize);
if (nSize < (unsigned int)m_lReceiveBufferSize)
break;
m_pReSampler->Read(m_lReceiveBufferSize);
if (ReceiveFrame() != FALSE) // Outputs m_pbyReceiveBuffer contents
{
bResult = TRUE;
}
}
...
}

[Toff]
8th March 2004, 18:02
What version of SSRC are you using ?
It looks like the one in foobar2k, if I remember correctly it use 32 bits floating point samples as input and output.

Haaan
8th March 2004, 19:10
I downloaded the last version on soundforge (ssrc-1.29).
I don't think it is an input format problem since i specified input and output bit_per_sample: 16 and use_float: 0.
If it was this kind of problem, i wouldn't be able to hear something "hearable" at all, and that's not the case, it's sounds like crap, but i can hear what Jack Bauer says on my sample mpeg ;).

Although, maybe if I use floating instead of integer it will work better ...