jsierles / react-native-audio

Audio recorder library for React Native
MIT License
1.16k stars 539 forks source link

include lossless codecs on Android #109

Closed marcejohnson closed 7 years ago

marcejohnson commented 7 years ago

flac and pcm/wave are available for android and should be added to the codec list in AudioRecorderManager.java. See:

...for list of codecs

The ios implementation already has lossless codecs, so this would provide feature parity, and with this addition they would share linear pcm lossless in common.

This is critical for applications that require lossless encoding, such as speech-to-text. For example see google's recommendation at https://cloud.google.com/speech/docs/best-practices: "Use a lossless codec to record and and transmit audio. FLAC or uncompressed is recommended."

Thanks!

jsierles commented 7 years ago

Would you be up for submitting a PR? thanks!

jsierles commented 7 years ago

I couldn't find the appropriate codec constants for this. Perhaps it's only supported for playback? See https://developer.android.com/reference/android/media/MediaRecorder.OutputFormat.html. Feel free to reopen this if you know how to implement FLAC or WAV recording!

buskerone commented 7 years ago

Recording audio to .wav would be great. I know that for iOS is possible https://github.com/rhaker/react-native-record-audio-ios For Android I have seen a lot of solutions, I agree that there is no .wav output format in the documentation but it seems that is possible: http://stackoverflow.com/questions/17192256/recording-wav-with-android-audiorecorder (old but it works)

davidgustys commented 7 years ago

Hi, has there any progress been made on this topic "lossless codec for android" ? Could we maybe reopen this ticket, i think its quite paramount that we have this for android?

And again to reference it seems that android does support "wave" encoding - https://developer.android.com/guide/topics/media/media-formats.html

What are your ideas?

jsierles commented 7 years ago

Hey, thanks for writing. Right now I'm not using this and have no motivation to continue supporting. However, the project is open source and you are welcome to submit a PR to implement this. Cheers!

dohvis commented 6 years ago

if someone want to record lossless audio, must use https://developer.android.com/reference/android/media/AudioRecord.html