I'm using this (@simform_solutions/react-native-audio-waveform) library to record audio and send it to the backend. The server returns a dynamic URL for the audio file. However, when I try to play the audio using that URL, I get the error: [Error: Failed to decode audio file].
The same URL works and plays correctly in the browser. I even tried using a regular MP3 file, but it shows the same error: 'Failed to decode audio file'.
<Waveform
mode="static"
ref={waveformRef}
path={"https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"}
candleSpace={3}
candleWidth={2.5}
waveColor="lightgray"
scrubColor="blue"
onPlayerStateChange={(state: string) => {
setPlayingState(state);
}}
onPanStateChange={() => {}}
containerStyle={{
backgroundColor: "transparent",
width: "100%",
alignSelf: "center",
borderRadius: 10,
}}
onCurrentProgressChange={(current: any, total: any) => {
setCurrentProgress(current);
setDuration(total);
}}
/>