简体   繁体   English

音频Android. 混合一首歌和一个声音录制!

[英]Audio Android.Mixing a song and a voice recorded!

I am developing a karaoke app and i have been dealing with audio from android.I want an opinion on how can i save a single song from a voice recorded and another song playing in the background.我正在开发一个卡拉 OK 应用程序,我一直在处理来自 android 的音频。我想就如何从录制的语音中保存一首歌曲和在后台播放的另一首歌曲提出意见。

Thanks谢谢

You can try FFMPEG Library for Android , consider using android wrapper .您可以尝试FFMPEG Library for Android ,考虑使用android 包装器 There are several SO answers of help有几个帮助答案

Audio song mixer in android programmatically android中的音频歌曲混合器以编程方式

How to overlay two audio files using ffmpeg 如何使用 ffmpeg 覆盖两个音频文件

FFmpeg on Android FFmpeg 上 Android

You may want to check amerge and amix ffmpeg filters based on your needs您可能需要根据需要检查amergeamix ffmpeg 过滤器

SoundPool is a good option if requirements can be met just by playing two audio streams together.如果只需同时播放两个音频流即可满足要求, SoundPool是一个不错的选择。

SoundPool can also manage the number of audio streams being rendered at once. SoundPool 还可以管理一次渲染的音频流的数量。 When the SoundPool object is constructed, the maxStreams parameter sets the maximum number of streams that can be played at a time from this single SoundPool.构造 SoundPool object 时,maxStreams 参数设置可以从该单个 SoundPool 一次播放的最大流数。

Also note Android - Lollipop version now supports multi-channel audio stream mixing另请注意Android - Lollipop版本现在支持多声道音频 stream 混合

Multi-channel audio stream mixing means professional audio applications can now mix up to eight channels including 5.1 and 7.1 channels.多声道音频 stream 混合意味着专业音频应用程序现在可以混合多达 8 个声道,包括 5.1 和 7.1 声道。

Multi-channel support多渠道支持

If your hardware and driver supports multichannel audio via HDMI, you can output the audio stream directly to the audio hardware.如果您的硬件和驱动程序支持通过 HDMI 的多声道音频,您可以 output 将音频 stream 直接连接到音频硬件。

Unfortunately, I don't think there's an "On device" way to combine two audio files into one.不幸的是,我认为没有将两个音频文件合并为一个的“设备上”方式。 The best you can do is play both at the same time from what I've read.你能做的最好的就是同时播放我读过的内容。

See Sound Pool Documentation请参阅声音池文档

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

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