简体   繁体   English

在播放之前,如何在 Android 中获取音频文件的振幅?

[英]How do you get amplitude of audio file in Android before you play it?

I know we can easily do it when we record it (several ways, actually).我知道当我们记录它时我们可以很容易地做到这一点(实际上有几种方式)。 But how are we going about getting an amplitude graph from an mp3/ogg file?但是我们如何从 mp3/ogg 文件中获取幅度图呢?

As it is now, I see two options: 1. Quickly play it & construct it while its playing 2. Try to do it with ffmpeg (but I really don't want to do NDK)就像现在一样,我看到两个选项:1. 快速播放并在播放时构建它 2. 尝试用 ffmpeg 来做(但我真的不想做 NDK)

Are there any other options beside these?除了这些还有其他选择吗? Thank you谢谢

You can try to use my library Amplituda which calculate amplitudes from audio and provide it in different formats like json, list of integers and sequences.您可以尝试使用我的库Amplituda ,它从音频中计算振幅并以不同的格式提供它,例如 json、整数和序列列表。

If you want to draw a waveform from amplitudes data, you can directly use my WaveformSeekBar library fork in which Amplituda implemented.如果你想从幅度数据中绘制波形,你可以直接使用我的WaveformSeekBar 库分支,其中 Amplituda 实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM