Displaying 3 results from an estimated 3 matches for "lchannel".
Did you mean:
channel
2005 Sep 30
2
Reg. FLAC decoding
...pThis->m_Decoder);
pThis->m_AudioSettings.PcmCdaParams.BitsPerSample = BitsPerSample;
pThis->m_AudioSettings.PcmCdaParams.SamplingFrequency =
FLAC__seekable_stream_decoder_get_sample_rate (pThis->m_Decoder);
pThis->ApplyAudioDecoderSettingsOnTheFly ();
unsigned char *LChannel, *RChannel;
unsigned int RPos, LPos;
LChannel = RChannel = (unsigned char *)buffer[0];
if (Channels > 1)
RChannel = (unsigned char *)buffer[1];
BytesPerSample = BitsPerSample >> 3;
LPos = RPos = 0;
/* Copy the decoded audio data to the DMA buffer. We have to
* interlea...
2005 Oct 06
2
Re: Reg. FLAC decoding
On Fri, 2005-09-30 at 23:14, Josh Coalson wrote:
> but all samples in buffer[] are 32-bit signed integers in host
> order, regardless of the bits-per-sample of the frame. so to get
> them down to shorts (assuming they'll fit), do like:
>
> FLAC__int32 * LChannel = buffer[0];
> short TempSource = (short)LChannel[LPos];
>
> instead of
>
> LChannel = (unsigned char *)buffer[0];
> short * TempSource = (short *)&LChannel[LPos];
> let me know if this works or if you have other questions.
I tried this., but still i dont get the...
2005 Sep 30
0
Re: Reg. FLAC decoding
...y) 16-bits, it looks like you're treating the samples
in buffer[] as packed 16 bit numbers.
but all samples in buffer[] are 32-bit signed integers in host
order, regardless of the bits-per-sample of the frame. so to get
them down to shorts (assuming they'll fit), do like:
FLAC__int32 * LChannel = buffer[0];
short TempSource = (short)LChannel[LPos];
instead of
LChannel = (unsigned char *)buffer[0];
short * TempSource = (short *)&LChannel[LPos];
etc.
also, it's probably faster and safer to get the #channels,
bits-per-sample, and sample rate from the the frame header
itself...