SimformSolutionsPvtLtd / react-native-audio-waveform

React Native component to show audio waveform with ease in react native application ✨
MIT License
74 stars 3 forks source link

ExpectedPoints is zero, cannot perform division #48

Open Exoplanetarium opened 4 weeks ago

Exoplanetarium commented 4 weeks ago

[Error: expectedPoints is zero, cannot perform division] received when using path that has been downloaded from remote URI:

const remoteUri = 'https://example.com/test_audio.mp3';
const localUri = FileSystem.documentDirectory + 'test_audio.mp3';
...
useEffect(() => {
    const downloadFile = async () => {
      try {
        const { uri } = await FileSystem.downloadAsync(remoteUri, localUri);
        console.log('File downloaded to:', uri);
        setFileExists(true);
        startPlayer();
      } catch (error) {
        console.error('Error downloading file:', error);
      }
    };
}, []);

where localUri is passed to the path prop. I'm using a bare javascript react-native setup (recently ejected from expo). I have confirmed that the file does exist both in the local and remote form.

mukesh-simform commented 4 weeks ago

Hi @Exoplanetarium Thank you for using this library and reporting this issue, Could you please share the complete localUri?