简体   繁体   English

我在哪里可以从 Android 框架中获取原始 PCM 数据?

[英]Where can I get the original PCM data from the Android framework?

Where can I get the original pcm data from the Android framework?哪里可以得到Android框架的原始pcm数据? I think I can get it from:我想我可以从:

Write (const void * buffer, size_t userSize, bool blocking)

in /framework/av/media/libmedia/AudioTrack.cpp/framework/av/media/libmedia/AudioTrack.cpp

However, it differs from the pcm data in the file before streaming service and the pcm data obtained in write.但是,它不同于流服务之前文件中的pcm数据和写入时获得的pcm数据。

I think it is like re-sampling.我认为这就像重新采样。

Where can I get original pcm data?我在哪里可以获得原始 pcm 数据?

Note:笔记:

  • The sound source is a FLAC sound source.音源为FLAC音源。
  • The Android version is 6.0.1.安卓版本为 6.0.1。

You have better chance of tapping the pcm buffer at one layer below the android-framework layer - audio hal.您有更好的机会在 android-framework 层下方的一层 - 音频 hal 处点击pcm缓冲区。 Now that would be dependent on the hardware hence I can provide you with some probable examples:-现在这将取决于硬件,因此我可以为您提供一些可能的示例:-

hardware/xxx/audio/hal/audio_hw.c (Where xxx is qcom in my case) hardware/xxx/audio/hal/audio_hw.c (在我的例子中xxx是qcom)
in_read() --> pcm_read() in_read() --> pcm_read()

external/tinyalsa/pcm.c
pcm_read()

AudioTrack.cpp 中的 PCM 数据将输入到 AudioMixer 和 AudioEffects 组件中以自定义效果,然后进入音频 HAL。

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

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