AndroidMic icon indicating copy to clipboard operation
AndroidMic copied to clipboard

Automatic audio resampling

Open teamclouday opened this issue 10 months ago • 2 comments

Right now the RustApp has an issue that it fails to start when the audio settings are not supported by the device. And sometimes the audio settings supported by the PC are not the same as the ones supported on Android phone.

microphone device -> android settings audio -> network -> rustapp audio settings audio -> audio output device

To address this issue, it's best to add an automatic resampler layer on the RustApp:

microphone device -> android settings audio -> network -> automatic resample -> rustapp audio settings audio -> audio output device

Three things to auto convert:

  1. sample rate
  2. channel count
  3. audio data type

Resample procedure:

  • convert data type to f32
  • convert channel count to 1
  • resample
  • convert data type to output type, with corresponding channel count

teamclouday avatar Mar 05 '25 08:03 teamclouday