Stream microphone to speakers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Stream microphone to speakers

virak
Dear gentle experts,

I'm working on the Karaoke project for both Android and iOS where a user
could record their performances (their video and vocal) and I use FFmpeg
for mixing music with their recordings. Anyway, I wish I could route/pipe
user vocal at realtime (capture thru device microphone) to an output device
(speaker) so the user could hear their voice at realtime applied with some
level of echo (to produce an effect as if we were in classic karaoke room).
Over weeks I have been struggling with searching the ways to implement that
based on FFmpeg, but no luck. Please kindly help.

Many thanks in advance.
Virak
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Stream microphone to speakers

Michael Koch
Am 07.08.2020 um 04:59 schrieb Vi Rak:

> Dear gentle experts,
>
> I'm working on the Karaoke project for both Android and iOS where a user
> could record their performances (their video and vocal) and I use FFmpeg
> for mixing music with their recordings. Anyway, I wish I could route/pipe
> user vocal at realtime (capture thru device microphone) to an output device
> (speaker) so the user could hear their voice at realtime applied with some
> level of echo (to produce an effect as if we were in classic karaoke room).
> Over weeks I have been struggling with searching the ways to implement that
> based on FFmpeg, but no luck. Please kindly help.

For Windows I have some examples in my book, please see chapters 3.19
and 3.20:
www.astro-electronic.de/FFmpeg_Book.pdf

Michael

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Stream microphone to speakers

Matteo Contrini
In reply to this post by virak
On Fri, 7 Aug 2020, at 4:59 AM, Vi Rak wrote:

> Dear gentle experts,
>
> I'm working on the Karaoke project for both Android and iOS where a user
> could record their performances (their video and vocal) and I use FFmpeg
> for mixing music with their recordings. Anyway, I wish I could route/pipe
> user vocal at realtime (capture thru device microphone) to an output device
> (speaker) so the user could hear their voice at realtime applied with some
> level of echo (to produce an effect as if we were in classic karaoke room).
> Over weeks I have been struggling with searching the ways to implement that
> based on FFmpeg, but no luck. Please kindly help.
>
> Many thanks in advance.
> Virak

On Android, what you can do is create a Linux named pipe using a native library (which calls `mkfifo` and `fcntl`), then capture the raw audio samples with `AudioRecord`, and write them to the pipe. When you spawn ffmpeg you can pass the pipe path as the input, making sure to choose the correct audio input format (like s16le). I've done this in the past for video streaming so it should work for audio as well.

--
Matteo
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".