YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.sendspin.hub.PcmResampler Class Reference

Converts 16 bit stereo PCM (little endian) from one sample rate to another by linear interpolation, for the audio of a source that has another rate than the group it is played in. More...

Collaboration diagram for de.yaacc.sendspin.hub.PcmResampler:
Collaboration graph

Public Member Functions

 PcmResampler (int sourceRate, int targetRate)
 
byte[] process (byte[] in, int offset, int length)
 

Detailed Description

Converts 16 bit stereo PCM (little endian) from one sample rate to another by linear interpolation, for the audio of a source that has another rate than the group it is played in.

The position is kept as an exact fraction (in 1/dst of an input frame), so that the result does not depend on how the audio is cut into pieces; the last frame and a half frame of a piece are kept for the next. The quality is that of a simple resampler (no filter against aliasing), which is enough for 44100 and 48000 Hz. Not thread safe.

Member Function Documentation

◆ process()

byte[] de.yaacc.sendspin.hub.PcmResampler.process ( byte[] in,
int offset,
int length )
Returns
the converted audio of this piece (whole frames); a half frame at the end is kept for the next call

Referenced by de.yaacc.sendspin.hub.SourceIngress.onChunk().

Here is the caller graph for this function:

The documentation for this class was generated from the following file: