question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can only play file once

See original GitHub issue

I have a component that loads a sound on constructor function and then plays it on some click handlers.

this.beepOn = new Sound('beep_short_on.wav', Sound.MAIN_BUNDLE, (error) => console.log(error));

However I only hear the sound the first time it this.beepOn.play() I’ve even tried stopping it at the end: this.beepOn.play(() => this.beepOn.stop())

Does anyone know why this might be happening.

react-native 0.30.0 react-native-sound: ^0.8.3

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

4reactions
sdeleon28commented, Aug 19, 2016

Can you try this workaround?

this.beepOn.play(() => {
  this.beepOn.setCurrentTime(0);
});
2reactions
rexlowcommented, Mar 10, 2017

Having the same issue here, none of the workarounds work for me

react-native 0.41.0 react-native-sound: 0.9.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

can only play files once in Windows Media player
can only play files once in Windows Media player · 1. Click the Start button, click Control Panel, click Programs, and then click...
Read more >
Play Audio File Once Only | WordPress.org
I'd like to present an audio file that the student can play only once and not be able to download the file. After...
Read more >
MCI play function can only play a MIDI file once - Stack Overflow
4) Yes, when a file is played twice it is only that file that fails. The other files still works. I have tried...
Read more >
How to Enable or Disable Multiple Instances of VLC Media ...
Enabling Multiple Instances · Go to Tools > Preferences [CTRL + P]. · Under Playlists and Instances, uncheck the option that says Use...
Read more >
If an audio or video file doesn't play on Mac - Apple Support
Older or specialized media formats might not work in your app, because the format requires software designed to support it. If that happens, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found