JackOfAll wrote: 
> 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;
  >                     }
  > 
--------------------
> > 

I think my initial branch will do this, but its just upsampling with a
power of 2 multipler to the highest rate below max sample rate.  Is this
logic ok?

Interested in what your tests are saying...  Resample branch on
googlecode should work for pcm and flac - would like to get some
feedback before we go much further.  Add -u to the command line to
enable it.


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

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to