Decrease update interval
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- audio-video-rtc, frontend
Research direction
Start at the Sound component's sound creation entry point, where html5PollingInterval and the onPlaying callback are configured. Check how the updateInterval prop is passed to soundmanager2 and how onPlaying timing is determined. Done means a documented, working interval control that produces the requested callback frequency.
Written by the indexing model from the issue text.
Description
Hi leoasis, I've been trying to find a way to control the interval to which onPlaying is called but couldn't find any in docs or source code.
So I tried understanding the code and build it myself but couldn't figure it out.
What I did was I added a new property called "updateInterval" and gave it to html5PollingInterval (the property I think is relevant to this usecase in soundmanager2).
This is a spinet of my change (at line 183) in your code:
177 this.stopCreatingSound = _createSound({
178 url: this.props.url,
179 autoLoad: this.props.autoLoad,
180 volume: this.props.volume,
181 position: this.props.playFromPosition || this.props.position || 0,
182 playbackRate: this.props.playbackRate,
183 html5PollingInterval: this.props.updateInterval,
184 whileloading: function whileloading() {
185 instance.props.onLoading(this);
186 },
And then in my code I added updateInterval and set it to 50:
<Sound
url={audioUrl}
playStatus={playStatus}
onPlaying={(player) => {handleOnPlaying(player);}}
position={audioPos}
onFinishedPlaying={handleFinishedPlaying}
updateInterval={50}
/>
But the result show an interval of about 200 to 300

This is crucial to my use case and would love to have your feedback.
Thank you in advance
- Dominant language
- JavaScript
- Stars
- 490
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from leoasis/react-sound
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
leoasis/react-sound#101 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
leoasis/react-sound#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
leoasis/react-sound#95 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
leoasis/react-sound#93 ·
-
怎么去获取当前播放时间? Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
leoasis/react-sound#92 ·
All issues in leoasis/react-sound
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100