Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMR or AMR_WB encoded recording on Android? #568

Open
Raccoonrider opened this issue Oct 26, 2023 · 0 comments
Open

AMR or AMR_WB encoded recording on Android? #568

Raccoonrider opened this issue Oct 26, 2023 · 0 comments

Comments

@Raccoonrider
Copy link

I'm trying to record audio for Google Speech-to-Text engine on Android.

I looked through the docs on configuration available here: https://github.com/hyochan/react-native-audio-recorder-player#able-to-customize-recorded-audio-quality-from-230

It looks like two of the configurable options are supported by Google Speech-to-Text: AMR 8000Hz mono and AMR_WB 16000Hz mono.

However, when I try the following config, I get a file as AAC LC 48000Hz stereo:

const audioSet: AudioSet = {
  AVSampleRateKeyIOS: 16000,
  AudioEncoderAndroid: AudioEncoderAndroidType.AMR_WB,
  AudioSourceAndroid: AudioSourceAndroidType.MIC,
  AVModeIOS: AVModeIOSOption.measurement,
  AVEncoderAudioQualityKeyIOS: AVEncoderAudioQualityIOSType.high,
  AVNumberOfChannelsKeyIOS: 1,
  AVFormatIDKeyIOS: AVEncodingOption.AMR_WB,
};

Am I using thie AudioSet incorrectly? Is it currently possible to record AMR/AMR_WB, or should I just use ffmpeg-kit?

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant