File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import { useCallback , useEffect , useState } from 'react' ;
22
33import { ScrollView , StyleSheet , Text , View } from 'react-native' ;
4- import { computeAmplitude } from 'react-native-audio-analyzer ' ;
4+ import { load , computeAmplitude } from '../../src ' ;
55import { robustScale , sample , scale , trimmedScale } from '../../src/helpers' ;
66
77export default function App ( ) {
88 const [ data , setData ] = useState < number [ ] > ( [ ] ) ;
99
1010 const run = useCallback ( async ( ) => {
1111 try {
12- const result = computeAmplitude (
13- '/data/data/audioanalyzer.example/files/sample.mp3' ,
14- 100
12+ const path = await load (
13+ 'https://file-examples.com/storage/fe180a8b03688f5559b9baf/2017/11/file_example_MP3_1MG.mp3'
1514 ) ;
15+ const result = computeAmplitude ( path , 100 ) ;
1616 setData ( result ) ;
1717 } catch ( raw ) {
1818 console . log ( raw ) ;
You can’t perform that action at this time.
0 commit comments