Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove silence after PitchSoundTransform #68

Open
alla2040 opened this issue Jan 22, 2018 · 1 comment
Open

Remove silence after PitchSoundTransform #68

alla2040 opened this issue Jan 22, 2018 · 1 comment
Labels

Comments

@alla2040
Copy link

alla2040 commented Jan 22, 2018

Thank you for your lib! Could you please help me with one question:
I am changing the pitch of the sound with this code (I run this on Android device):
FluentClient.start() .withFile(destinationFile) .convertIntoSound() .apply(new PitchSoundTransform(100 + soundPitch)) // soundPitch - is my rate .exportToFile(destinationFile);

And after that I use ExoPlayer to play audio file. On audio finishes I stop the video. But after PitchSoundTransform the size of the file stays the same, so the video is playing but the audio (music) is stopped. I tried to fix this with stopWithSound():

FluentClientReady fluentClient = FluentClient.start(); Sound sound = fluentClient.withFile(destinationFile).convertIntoSound() .apply(new PitchSoundTransform(100 + soundPitch)).stopWithSound(); fluentClient.withSound(sound).exportToFile(destinationFile);

but it didn't help.
Can you please advise how to fix it?

@libetl
Copy link
Owner

libetl commented Jan 22, 2018

Hmmm... So the sound duration stays the same even after pitching ?

Try to add a loop sound transform after your pitch transform.

FluentClient.start() .withFile(destinationFile) .convertIntoSound()
 .apply(new PitchSoundTransform(100 + soundPitch))
 .apply(new LoopSoundTransform(
    voiceSound.getSamplesLength() * (100 - soundPitch) / 100.0))
 .exportToFile(destinationFile);

@libetl libetl added the support label Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants