Questions tagged [react-native-sound]

79 questions
0
votes
1 answer

React-native-sound creates infinite loop

I'm using react-native-sound library in order to play one track multiple times. Here is my code: const playAudio = () => { sound.setNumberOfLoops(2).play() } playAudio() I wonder why the track is played infinite times.
Xenia
  • 87
  • 6
0
votes
3 answers

How can I play tracks one after another from the array in React Native?

I used such libraries as react-native-sound and react-native-audio-recorder-player in order to play tracks from an array. I tried mapping the array but it plays just the first track. Is there any method that I can use to play all tracks from the…
Xenia
  • 87
  • 6
0
votes
1 answer

How to trigger some sound on background when push notification(firebase) received ~ React Native

I am building an application similar to Swiggy, So When getting a new order from a customer, I am triggering a push notification, At that time I need to trigger a different Horn Sound. Modules used: // For Firebase…
Premji
  • 69
  • 1
  • 6
0
votes
1 answer

React native app can not play mp3 after disconnecting from computer

I save an mp3 file named 'sound1.mp3' in assets folder. In App.js, I call: let sound1 = new Sound(requires('./assets/sound1.mp3'), Sound.MAIN_BUNDLE, (error) => {}); sound1.play((ok) => {}); It worked. But when I disconnect my android phone from my…
0
votes
1 answer

react-native-sound always showing current playback time as 0

I am using react-native-sound to create an audio player, I want to get the current playback timings of the sound while it plays however when I use the getCurrentTime callback, it is only showing 0. Below is the code for the same: const listenaudio =…
TRINA CHAUDHURI
  • 627
  • 1
  • 11
  • 42
0
votes
2 answers

react-native-sound audio file not playing in iOS 13

I'm playing sound using react-native-sound and is playing on iOS 12 device but when I check in iOS 13 device is not playing. here is my code this.soundPlayer = new Sound(require('../assets/fly.mp3'), '', (error) => { console.log(error) …
Akshay I
  • 3,675
  • 1
  • 34
  • 57
0
votes
1 answer

Storing recorded sound clip on server using PHP in React Native

I am recording short audio clips and want to save them on a server using PHP, i.e. I have a recording object which creates .caf file, (ideally I want to convert it to MP3 and save it but that's a separate issue). but I want to save that file on a…
Waqar
  • 101
  • 2
  • 11
0
votes
1 answer

react-native-sound no sound from Android (only Genymotion emulator)

I've added the code to play sounds in my react native app. I've tried specifying the audio file location in various ways: const soundInfo = { url: require('./sound.wav'), } with: new Sound(soundInfo.url, error =>…
user4966361
0
votes
1 answer

Playing sound on cards

I have application with cards on stack (a lot of cards - about 500) I card component I added: function getVoice() { try { const mySound = new Sound(getSoundName(id), Sound.MAIN_BUNDLE, (error) => { if (error)…
DeveloperApps
  • 763
  • 7
  • 16
0
votes
1 answer

is there a way to get a value from json as a variable in react native

I am trying to create an app in react native. I have information stored in a database. I use php to get the information for the database using a query. I then use fetch to get the information and I am able to get the information and display it as…
CodeLover
  • 166
  • 1
  • 11
  • 34
0
votes
1 answer

React-native-sound: setSpeakerphoneOn doesn't work

I looked up documentation for setSpeakerphoneOn at https://github.com/zmxv/react-native-sound/wiki/API, where it states that you just need to pass a boolean value into it. What I'm trying to achieve is to have a toggle button for switching on and…
Anya
  • 1
0
votes
2 answers

One Touchable Opacity for Play and Pause

I want to use one TouchableOpacity for Play and Pause. I am Using Audio from Firebase Server and react-native-sound to Play and Pause the Audio. Here is My Code: constructor(props) { super(props) this.state = { isPlaying: true …
0
votes
1 answer

React Native react-native-sound Changing Sound file at run time gives error "Attempted to assign to readonly property"

I am new to React-Native. And am trying to develop an Audio App, where the user should be able to click on any Audio from a list, and that Audio should Play onPress() Here is my code sound = new Sound('http://example.com/xyz.mp3'); playSound () { …
AnR
  • 1,809
  • 3
  • 26
  • 45
0
votes
0 answers

Android is not ducking sound (react-native-sound)

iOS is ducking sound just fine, but the Android is not ducking. Should ducking be the default behaviour for Android with this module? Is there a way to duck the audio through react-native-sound or any other method?
Oskar Gusgård
  • 457
  • 7
  • 20
0
votes
2 answers

react-native-sound stop all sounds

I want to play long audio files from the list, the files are downloaded on first tap, all next taps play the audio. But the problem is that when playing one file and I tap another, the first one is still playing and the next one is playing too. Is…