ryanheise / just_audio

Audio Player
1.03k stars 646 forks source link

Pitch adjustment #329

Open ryanheise opened 3 years ago

ryanheise commented 3 years ago

Is your feature request related to a problem? Please describe.

Pitch adjustment would be useful in some apps (e.g. changing pitch of voice or music).

Describe the solution you'd like

player.setPitch(1.0); // 1.0 being normal pitch

Describe alternatives you've considered

There is no other way to achieve this other than plugin support.

Additional context

This is easily implemented on Android, iOS might be more problematic (post below if you are able to share useful resources/documentation)

ryanheise commented 6 months ago

This is something that would require an AVAudioEngine-based implementation. You could take a look at #784 as a starting point, and consider contributing to it to add pitch adjustment.

GayakEngineer commented 2 months ago

@ryanheise Hello. I could not find any documentation on setPitch(). What do i have to pass as argument to setPitch() ? What would be the factor, in order to shift pitch by one semitone.

In android flutter app, just audioplayer_name.setPitch(pitch); is enough, am i right?

ryanheise commented 2 months ago

@GayakEngineer

Hello. I could not find any documentation on setPitch().

It should be there on https://pub.dev/packages/just_audio under the link "API Documentation". Find the class (i.e. AudioPlayer), then find the thing inside the class (i.e. setPitch). The README page gives the supported platforms (as mentioned above, only Android).

In android flutter app, just audioplayer_name.setPitch(pitch); is enough, am i right?

That same comment above confirms this is correct.

GayakEngineer commented 2 months ago

@GayakEngineer

Hello. I could not find any documentation on setPitch().

It should be there on https://pub.dev/packages/just_audio under the link "API Documentation". Find the class (i.e. AudioPlayer), then find the thing inside the class (i.e. setPitch). The README page gives the supported platforms (as mentioned above, only Android).

In android flutter app, just audioplayer_name.setPitch(pitch); is enough, am i right?

That same comment above confirms this is correct.

Thank you for such a prompt reply. You have done great service to flutter community.

GayakEngineer commented 1 month ago

@ryanheise any update on setPitch for iOS?

ryanheise commented 1 month ago

The iOS side depends on rewriting using AVAudioEngine (see #334 for further details)