Skip to content

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

@thedroiddiv

Description

@thedroiddiv

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)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions