react-native-audio-waveform icon indicating copy to clipboard operation
react-native-audio-waveform copied to clipboard

ExpectedPoints is zero, cannot perform division

Open Exoplanetarium opened this issue 1 year ago • 1 comments
trafficstars

[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.

Exoplanetarium avatar Jul 02 '24 03:07 Exoplanetarium

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

mukesh-simform avatar Jul 03 '24 11:07 mukesh-simform