0

I'm trying to integrate Oboe Resampler in my android application.

https://github.com/google/oboe/tree/master/src/flowgraph/resampler

The idea is to convert ByteBuffer of audio that comes with 32000 sample rate in audio with 44100 sample rate.

How I should build the C++ library and how should I integrate and do the resampling in my android application? Can someone share some snippet or link to the already built version of this c++ library?

Blagojco
  • 326
  • 1
  • 2
  • 9

1 Answers1

1

You don't need to build the resampler to do this as it's already in Oboe. You can just open an Oboe audio stream with a sample rate of 32000 frames/sec and switch on resampling.

Here's how:

// Create a stream builder
oboe::AudioStreamBuilder builder;

// Specify the rate at which you'll be supplying audio frames
builder.setSampleRate(32000);

// Switch on the resampler by specifying the resampling quality - this is a tradeoff between CPU and quality. 
builder.setSampleRateConversionQuality(SampleRateConversionQuality::Medium);

See the docs for setting up a data callback where you can write your ByteBuffer into the audio stream buffer.

donturner
  • 17,867
  • 8
  • 59
  • 81