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

Add useSound Hook #393

Closed
tusharbhambere opened this issue Nov 8, 2023 · 2 comments
Closed

Add useSound Hook #393

tusharbhambere opened this issue Nov 8, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request needs triage

Comments

@tusharbhambere
Copy link

Is your feature request related to a problem? Please describe.
I'm currently working on a Flutter project that requires audio playback, and the flutter_hooks library lacks a convenient way to manage and control audio. It's essential to have a useSound hook to simplify audio management in Flutter applications.

Describe the solution you'd like
I would like to see a useSound hook similar to the one available in the use-sound JavaScript library. This hook should allow developers to easily load and play audio files, control playback, and manage audio state within their Flutter applications.

Describe alternatives you've considered
I've considered using existing Flutter audio packages, but they don't offer the same level of simplicity and integration that a dedicated useSound hook could provide.

Additional context
Adding a useSound hook would greatly benefit Flutter developers who want to create interactive apps with audio elements, such as games or music players. It would simplify audio management, making it easier to control volume, playback, and handle other audio-related tasks within the flutter_hooks framework.

@davidmartos96
Copy link
Contributor

You can compose your own hooks to use with your dependencies. Adding such hook would force this package to depend on audio packages and not solely on core packages.

Check out this about composing hooks to develop your own: https://react.dev/learn/reusing-logic-with-custom-hooks

@rrousselGit
Copy link
Owner

Flutter_hooks will not contain anything that requires a third-party package. As such, there won't be such a hook.

You can make your own hook/package though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

3 participants