Skip to content

Dynamic URL ( got from server ) cannot able to play. [Error: Failed to decode audio file] #192

@jitendra1021

Description

@jitendra1021

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);
}}
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions