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

Question: Using a periodic stream instead of audioPlayer.positionStream #139

Open
intonarumori opened this issue Jan 16, 2025 · 1 comment

Comments

@intonarumori
Copy link

I'm working on an audio app for a local radio station using just_audio.

I noticed that this project uses a periodic stream instead of the audioPlayer.positionStream to track playback progress.
I had some issues using the latter in my own app resulting in high CPU usage and the phone getting hot, and I was wondering if this decision was based on similar experiences?

Congratulations to this projects, it serves as a great example of using just_audio and greatly helps as a reference for other audio enabled apps trying to achieve similar goals.

Many thanks.

@amugofjava
Copy link
Owner

Hi @intonarumori,

The positionStream from just_audio varies in how frequently it pushes to the stream based on the length of the audio, from 16ms to 200ms. I don't need such a frequent update in Anytime, so I rolled my own to keep the update frequency consistent at just 500ms and hopefully save some battery in the process too.

Thanks for your feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants