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

How to change audio sample rate? #567

Open
opticalix opened this issue Dec 20, 2024 · 0 comments
Open

How to change audio sample rate? #567

opticalix opened this issue Dec 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@opticalix
Copy link

Audio recognition model I use requires 16khz sample rate. I try to add sink of remote audio:

AudioTrackSink {
            override fun onData(
                audioData: ByteBuffer?,
                bitsPerSample: Int,
                sampleRate: Int,
                numberOfChannels: Int,
                numberOfFrames: Int,
                absoluteCaptureTimestampMs: Long
            ) {}

and callback of local audio:

override fun onBuffer(
                    buffer: ByteBuffer,
                    audioFormat: Int,
                    channelCount: Int,
                    sampleRate: Int,
                    bytesRead: Int,
                    captureTimeNs: Long
                )

but 'sampleRate' I got is all 48khz. Is there any way to config the SAMPLE RATE?

Device Info:

  • Device: [Xiaomi 14]
  • OS: [Android 13]
  • LiveKit SDK version: [2.11.0]
@opticalix opticalix added the bug Something isn't working label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant