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

Output samples per second is 10 irrespective of the preferredSamplesPerSecond given #65

Open
thedroiddiv opened this issue Nov 7, 2023 · 0 comments

Comments

@thedroiddiv
Copy link

Describe the bug
Output samples per second is 10 irrespective of the preferredSamplesPerSecond given

To Reproduce
Steps to reproduce the behavior:

  1. I'm using this helper class
object AudioManager {
    private lateinit var amplituda: Amplituda
    fun getAmplitudes(context: Context, audioFilePath: String): Pair<List<Int>, Long> {
        if (!::amplituda.isInitialized) {
            amplituda = Amplituda(context)
        }
        var amplitudes = listOf<Int>()
        var duration = 0L
        amplituda.processAudio(audioFilePath, Compress.withParams(Compress.AVERAGE, 50))
            .get({
                amplitudes = it.amplitudesAsList()
                Log.d("TAG", "getAmplitudes: ${it.amplitudesForSecond(1).size}")
                duration = it.getAudioDuration(AmplitudaResult.DurationUnit.MILLIS)
            }, { e ->
                Log.e("AudioManager::", "getAmplitudes: ", e)
            })
        return Pair(amplitudes, duration)
    }
}

Expected behavior
Expected Log: getAmplitudes: 50

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot 2023-11-07 at 6 19 16 PM (2)

Smartphone (please complete the following information):

  • Device: Google Pixel 6a
  • OS: Android 14 (API 34)
@thedroiddiv thedroiddiv changed the title Output samples per second is 10 irrespective of the preferredSamplesPerSecond given Output samples per second is 10 irrespective of the preferredSamplesPerSecond given Nov 7, 2023
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