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

Not working with ENCODING_PCM_FLOAT #16

Open
sixdaystudio opened this issue Nov 17, 2022 · 3 comments
Open

Not working with ENCODING_PCM_FLOAT #16

sixdaystudio opened this issue Nov 17, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@sixdaystudio
Copy link

When I configure the wave with waveRecorder.waveConfig.audioEncoding = AudioFormat.ENCODING_PCM_FLOAT the recorder bugs and creates a audio file with 44bytes. Any chance to implement this feature to allow recording audio with AudioFormat.ENCODING_PCM_FLOAT ?

Thanks.

@squti
Copy link
Owner

squti commented Nov 19, 2022

The library doesn't support ENCODING_PCM_FLOAT and ENCODING_PCM_32BIT currently, But we will try to add this feature in the next release.

@squti squti added the enhancement New feature or request label Dec 4, 2022
@farfromrefug
Copy link

@squti i really need this right now. I am ok implementing. Can you explain a bit where it fails with ENCODING_PCM_FLOAT and ENCODING_PCM_32BIT ?

@squti
Copy link
Owner

squti commented Jan 29, 2023

@farfromrefug You need to add these lines to bitPerSample function in WaveConfig.kt file.

 AudioFormat.ENCODING_PCM_32BIT -> 32
 AudioFormat.ENCODING_PCM_FLOAT -> 32

For ENCODING_PCM_FLOAT You also need to write another function like writeAudioDataToStorage in WaveRecorder.kt which reads data in the type of FloatArray instead of ByteArray.

You also need a function to check if the device supports ENCODING_PCM_32BIT and ENCODING_PCM_FLOAT before recording.

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

No branches or pull requests

3 participants