AudioResampler.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.9
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. package org.doubango.tinyWRAP;
  9. public class AudioResampler {
  10. private long swigCPtr;
  11. protected boolean swigCMemOwn;
  12. protected AudioResampler(long cPtr, boolean cMemoryOwn) {
  13. swigCMemOwn = cMemoryOwn;
  14. swigCPtr = cPtr;
  15. }
  16. protected static long getCPtr(AudioResampler obj) {
  17. return (obj == null) ? 0 : obj.swigCPtr;
  18. }
  19. protected void finalize() {
  20. delete();
  21. }
  22. public synchronized void delete() {
  23. if (swigCPtr != 0) {
  24. if (swigCMemOwn) {
  25. swigCMemOwn = false;
  26. tinyWRAPJNI.delete_AudioResampler(swigCPtr);
  27. }
  28. swigCPtr = 0;
  29. }
  30. }
  31. public AudioResampler(long nInFreq, long nOutFreq, long nFrameDuration, long nChannels, long nQuality) {
  32. this(tinyWRAPJNI.new_AudioResampler(nInFreq, nOutFreq, nFrameDuration, nChannels, nQuality), true);
  33. }
  34. public boolean isValid() {
  35. return tinyWRAPJNI.AudioResampler_isValid(swigCPtr, this);
  36. }
  37. public long getOutputRequiredSizeInShort() {
  38. return tinyWRAPJNI.AudioResampler_getOutputRequiredSizeInShort(swigCPtr, this);
  39. }
  40. public long getInputRequiredSizeInShort() {
  41. return tinyWRAPJNI.AudioResampler_getInputRequiredSizeInShort(swigCPtr, this);
  42. }
  43. public long process(java.nio.ByteBuffer pInData, long nInSizeInBytes, java.nio.ByteBuffer pOutData, long nOutSizeInBytes) {
  44. return tinyWRAPJNI.AudioResampler_process(swigCPtr, this, pInData, nInSizeInBytes, pOutData, nOutSizeInBytes);
  45. }
  46. }