android_audio_mixer icon indicating copy to clipboard operation
android_audio_mixer copied to clipboard

Sequential concatentation to start before the previous sound has finished

Open ThomasVeitch opened this issue 4 years ago • 16 comments

Not really an issue but a requirement.

It would be useful if you were able to make a wav file from many wav files. But instead of sequentially waiting until one sound finished before concatenating it to the end, you can start a sound before the first finished. So really I'm looking for a mixture of parallel and sequential, but the sequential being able to be added at a specific time before the previous sound has finished. Is this possible? Could you do it?

Thanks.

ThomasVeitch avatar Aug 06 '20 12:08 ThomasVeitch

What you want can be done by this. You just need to use parallel mixing with blank audio input.

Aren't wav files supported?

ZeroOneZeroR avatar Aug 06 '20 12:08 ZeroOneZeroR

Thanks for getting back to me quickly,

You'll have to detail this as I've tried

audioMixer.addDataSource(input1); // 2 secs long audioMixer.addDataSource(blankInput); // 0.5 secs gap audioMixer.addDataSource(input2); // 2 secs long

audioMixer.setMixingType(AudioMixer.MixingType.PARALLEL);

The desired output would be to play at 0 secs input 1; then at 0.5 secs play input 2. (when input 1 is still playing)

The above is just putting everything in parallel so they all play at the same time.

If I change the setting to SEQUENTIAL then at 0 secs input 1 is played, then at 2 secs there is a gap at 2.5 secs input 2 is played.

Please explain how to achieve desired output.

Tom

On Thu, 6 Aug 2020 at 13:29, Rakibul Hasan Rajib [email protected] wrote:

What you want can be done by this. You just need to use parallel mixing with blank audio input.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rajib010/android_audio_mixer/issues/3#issuecomment-669897268, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7LABH3FMZELRM6HI7WIN3R7KOZBANCNFSM4PWQ43RQ .

ThomasVeitch avatar Aug 06 '20 12:08 ThomasVeitch

Sorry, I gave the wrong answer. Currently this not possible with this. Need to do some work.

ZeroOneZeroR avatar Aug 06 '20 12:08 ZeroOneZeroR

Thanks.

I look forward to it!

Tom.

On Thu, 6 Aug 2020 at 13:54, Rakibul Hasan Rajib [email protected] wrote:

Sorry, I gave the wrong answer. Currently this not possible with this. Need to do some work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rajib010/android_audio_mixer/issues/3#issuecomment-669908673, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7LABBQBJGLSQ6AYWQFJFDR7KRXVANCNFSM4PWQ43RQ .

ThomasVeitch avatar Aug 06 '20 13:08 ThomasVeitch

Hi Rakibul,

When will this be ready? I'd really like this functionality.

Tom

On Thu, 6 Aug 2020 at 14:39, Tom Veitch [email protected] wrote:

Thanks.

I look forward to it!

Tom.

On Thu, 6 Aug 2020 at 13:54, Rakibul Hasan Rajib [email protected] wrote:

Sorry, I gave the wrong answer. Currently this not possible with this. Need to do some work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rajib010/android_audio_mixer/issues/3#issuecomment-669908673, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7LABBQBJGLSQ6AYWQFJFDR7KRXVANCNFSM4PWQ43RQ .

ThomasVeitch avatar Aug 13 '20 16:08 ThomasVeitch

I will work on it soon.

ZeroOneZeroR avatar Aug 13 '20 16:08 ZeroOneZeroR

Your problem has been solved. You can now set startOffsetUs() to GeneralAudioInput. Use version v1.1

ZeroOneZeroR avatar Aug 24 '20 12:08 ZeroOneZeroR

Do you have the previous version's code? I need the README.md file. Could you provide me with that, please?

ZeroOneZeroR avatar Aug 24 '20 12:08 ZeroOneZeroR

Just did a quick rattle test and it's looking fantastic. So many thanks. It's looking like an excellent API.

On Mon, 24 Aug 2020 at 13:25, Rakibul Hasan Rajib [email protected] wrote:

Your problem has been solved. You can now set startOffsetUs() to GeneralAudioInput.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rajib010/android_audio_mixer/issues/3#issuecomment-679095367, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7LABENXY7U6XP4NSKD2X3SCJL37ANCNFSM4PWQ43RQ .

ThomasVeitch avatar Aug 25 '20 12:08 ThomasVeitch

Thank you so much.

ZeroOneZeroR avatar Aug 25 '20 12:08 ZeroOneZeroR

Hi Rakibul, We are using the API in a proper project and it's become apparent we need some functionality adding. We have created about a 10second wav file and we intend to loop it using MediaPlayer setLooping(true) The issue is we don't want to wait until the loop has finished to start again. We want to start the next loop at a designated time before the previous loop has finished. Would this be possible? Thanks.

On Tue, 25 Aug 2020 at 13:44, Rakibul Hasan Rajib [email protected] wrote:

Thank you so much.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rajib010/android_audio_mixer/issues/3#issuecomment-680001624, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7LABG6OZIXYY6OOIFY33LSCOWZLANCNFSM4PWQ43RQ .

ThomasVeitch avatar Sep 09 '20 15:09 ThomasVeitch

You want this while playing with Mediaplayer? I haven't got you properly.

ZeroOneZeroR avatar Sep 09 '20 15:09 ZeroOneZeroR

Yes. Thanks to your API we have created a 15 second .wav file with lots of individual sounds running in parallel and sequentially. With the offSet functionality we have been able to mix sounds properly without having to wait until a previous sound has finished.

However we intend to loop this newly created 15 second .wav file. We are using MediaPlayer to play this .wav file.

Unfortunately, when trying to loop this new .wav file, you have to wait until the whole wav file has finished playing. Are you able to extend your functionality so that we can loop the wav file, without having to wait until the very end of the file. We need to able to start the new loop at a designated offset before the previous loop has finished.

On Wed, 9 Sep 2020 at 16:12, rajib010 [email protected] wrote:

You want this while playing with Mediaplayer? I haven't got you properly.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rajib010/android_audio_mixer/issues/3#issuecomment-689627775, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7LABDAKV7UPUUISSV5QP3SE6LNRANCNFSM4PWQ43RQ .

ThomasVeitch avatar Sep 09 '20 15:09 ThomasVeitch

You can add one audio multiple times. You can add the previous Audios again with new AudioInputs with your required settings. You have to calculate the startOffset for looping.

ZeroOneZeroR avatar Sep 09 '20 15:09 ZeroOneZeroR

The issue with creating a huge wav file with AudioMixer (and not looping in MediaPlayer) is that it''s slow to create and the volume is really low.

On Wed, 9 Sep 2020 at 16:31, rajib010 [email protected] wrote:

You can add one audio multiple times. You can add the previous Audios again with new AudioInputs with your required settings. You have to calculate the startOffset for looping.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rajib010/android_audio_mixer/issues/3#issuecomment-689639665, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7LABESVNW2XLN4N7JPVZDSE6NTTANCNFSM4PWQ43RQ .

ThomasVeitch avatar Sep 09 '20 21:09 ThomasVeitch

Maybe i will have to do something to maintain the volume. I already have thought about it. Let me do something with volume. But i can't do anything with timing.

ZeroOneZeroR avatar Sep 10 '20 03:09 ZeroOneZeroR