c - PCM-downsampling: input-frames/output-frames vs. buffer-size -


i have program reads

4096 frames (16384 bytes) 16bit le 48000 hz pcm 

into 16384 bytes large buffer per "read" kernel module (= read alsa's ring-buffer).

after each "read" have downsample 48 khz 44.1 khz , output must smaller/equal 4096 frames (streaming apple's airport express).

it works, output sounds "too fast" , "flickering" (i think due lost frames in "read", described below), stops (i think "too fast" causes "wait data").

for resampling use src_process libsamplerate (aka secret rabbit code):

int src_process (src_state *state, src_data *data) ; 

with following parameters:

  data_in       : pointer input data samples.   input_frames  : 4096   data_out      : pointer output data samples.   output_frames : 4096   src_ratio     : 44100 / 48000 -> 0,91875 

my kernel module tells me when missed frames in alsa's ring-buffer inside , happens.

i'am missing 100 frames / "read".

maybe understands problem , can "4096 frames-buffer small" or else.

meanwhile re-check code.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -