Triode wrote: 
> Hum - thats interesting - only just started to look at it, will be
> intested if you can work out why...

I'll be interested if I can work out why. ;) I've now gone off at a bit
of a tangent again with an exe from Example 3 that I have put a Java
wrapper around, so I can switch between libsoxr re-sampling and sox exe
re-sampling on the back-end.

One other thought before I forget. Either by default or with an option
to force "integer multiple" oversampling rather than upsampling where
everything is forced to 384k regardless of whether the original rate is
an integer multiple or not. (ie. 44k1, 88k2, 176k4 -> 352k8 rather than
384k.) You've got max_sample_rate either from "-r" or opening the audio
device......


Code:
--------------------
    
  int oversample = 8;
  long outputRate = song_rate;
  
                        long requestedOutputRate = oversample * song_rate;  
                        if (requestedOutputRate > maxSampleRate) {
                                if (!asyncOutputRate) {
                                        // make sure outputRate is an integer 
multiple of the original rate
                                        if ((maxSampleRate % 12000L == 0) && 
(song_rate % 11025 == 0)) {
                                                outputRate = maxSampleRate * 
11025L / 12000L;
                                        } else {
                                                outputRate = maxSampleRate;
                                        }
                                } else {
                                        outputRate = maxSampleRate;
                                }
                        } else {
  outputRate = requestedOutputRate;
                        }
  
--------------------


------------------------------------------------------------------------
JackOfAll's Profile: http://forums.slimdevices.com/member.php?userid=3069
View this thread: http://forums.slimdevices.com/showthread.php?t=98544

_______________________________________________
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to