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

Unable to get renderer data for custom audio device with certain audio config #644

Closed
mattfeury opened this issue Jan 13, 2025 · 1 comment

Comments

@mattfeury
Copy link

mattfeury commented Jan 13, 2025

Description

Hello, I am referencing the FileAndMicAudioDevice.java example to create my own renderer (speaker). I am wanting to get data spit out in a bytearray of the format:

AudioFormat.AUDIO_SAMPLE_RATE_8000 sample rate and AudioFormat.AUDIO_SAMPLE_MONO channel config and 8 bit bit depth. I want to get data every 100ms (updating CALLBACK_BUFFER_SIZE_MS from 10ms). This means I should expect a buffer size of about 800 bytes. When I change the values to support this configuration, I see the following error message:

 [Platform](509364116656): Invalid argument: provided buffer size is greater than renderer buffer size 800 160

Is it not possible to get data in this format? I am seeing the appropriate buffer size calculated (800) but it sounds like the Twilio sdk is still expecting it to be 160? (It seems twilio is maybe holding channel count and CALLBACK_BUFFER_SIZE_MS constant, because if those are 2 and 10 respectively, the numbers would equal)

Expected Behavior

I receive data every 100ms with 800 bytes.

Actual Behavior

No data is provided. This error is constantly logged

 [Platform](509364116656): Invalid argument: provided buffer size is greater than renderer buffer size 800 160

Reproduces How Often

Every time

Voice Android SDK

com.twilio:voice-android:5.7.2

OS Version

13

Device Model

[e.g. Nexus 6p]

@mattfeury
Copy link
Author

i think this was happening because i was attempting to get 8 bit data and it seems like it's required to be 16. this is why only stereo worked because it was * 2. going to close this for now unless something else crops up

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