Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project setup #5

Open
pedropcamellon opened this issue Oct 16, 2022 · 0 comments
Open

Project setup #5

pedropcamellon opened this issue Oct 16, 2022 · 0 comments

Comments

@pedropcamellon
Copy link

pedropcamellon commented Oct 16, 2022

Do I need to install make and emsdk on my PC for building the project?

git submodule update --init # pull in Chord-Detector-and-Chromagram
npm run build # requires emscripten's emcc to be on your path

After I installed and setup make and emsdk I was able to run make on project root dir.


/chord_detector>> make

emcc -O3 vendor/Chord-Detector-and-Chromagram/libs/kiss_fft130/kiss_fft.c -o build/kiss_fft.o
shared:INFO: (Emscripten: Running sanity checks)

emcc: warning: object file output extension (.o) used for non-object output.  If you meant to build an object file please use `-c, `-r`, or `-shared` [-Wemcc]

emcc -O3 -I vendor/Chord-Detector-and-Chromagram/libs/kiss_fft130 -D USE_KISS_FFT vendor/Chord-Detector-and-Chromagram/src/Chromagram.cpp -o build/Chromagram.o

emcc: warning: object file output extension (.o) used for non-object output.  If you meant to build an object file please use `-c, `-r`, or `-shared` [-Wemcc]
emcc -O3 vendor/Chord-Detector-and-Chromagram/src/ChordDetector.cpp -o build/ChordDetector.o

emcc: warning: object file output extension (.o) used for non-object output.  If you meant to build an object file please use `-c, `-r`, or `-shared` [-Wemcc]

emcc -O3 --memory-init-file 0 chord_detector_wrapper.cpp -o index.js -s EXPORTED_FUNCTIONS="['_Chromagram_constructor','_Chromagram_destructor','_Chromagram_processAudioFrame', '_Chromagram_isReady', '_Chromagram_getChromagram', '_ChordDetector_constructor', '_ChordDetector_destructor', '_ChordDetector_detectChord', '_ChordDetector_getRootNote', '_ChordDetector_getQuality', '_ChordDetector_getIntervals']" -D USE_KISS_FFT -I vendor/Chord-Detector-and-Chromagram/src -I vendor/Chord-Detector-and-Chromagram/libs/kiss_fft130 build/*.o --post-js chord_detector.js

emcc: error: build/*.o: No such file or directory ("build/*.o" was expected to be an input file, based on the commandline arguments provided)

make: *** [index.js] Error 1

I ignored the error and tried running:

/chord_detector>> npm run build

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> chord_detector@1.0.5 build
> make; cd docs; browserify demo.js -o bundle.js

make: *** There is no rule to build the target `;'.  Stop.

I tried opening docs/index.html:
image

I get this errors:

bundle.js:8 

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.
(anonymous) @ bundle.js:8
j @ jquery-3.1.1.slim.min.js:2
k @ jquery-3.1.1.slim.min.js:2
setTimeout (async)
(anonymous) @ jquery-3.1.1.slim.min.js:2
i @ jquery-3.1.1.slim.min.js:2
fireWith @ jquery-3.1.1.slim.min.js:2
fire @ jquery-3.1.1.slim.min.js:2
i @ jquery-3.1.1.slim.min.js:2
fireWith @ jquery-3.1.1.slim.min.js:2
ready @ jquery-3.1.1.slim.min.js:3
R @ jquery-3.1.1.slim.min.js:3
bundle.js:61 

[Deprecation] The ScriptProcessorNode is deprecated. Use AudioWorkletNode instead. (https://bit.ly/audio-worklet)

When hitting play buttons in the console I get this error:

MediaElementAudioSource outputs zeroes due to CORS access restrictions for file:///.../chord_detector/docs/A-Chord.ogg

So I run a server for loading app.

bundle.js:61 

[Deprecation] The ScriptProcessorNode is deprecated. Use AudioWorkletNode instead. (https://bit.ly/audio-worklet)
(anonymous) @ bundle.js:61

bundle.js:63 

[874] onaudioprocess    // This fn keeps running after the played audio stops.

All audios only plays once. After playing all audios for the second time onaudioprocess and I get this errors:

bundle.js:20 
        
Uncaught DOMException: Failed to execute 'createMediaElementSource' on 'AudioContext': HTMLMediaElement already connected previously to a different MediaElementSourceNode.
    at HTMLAudioElement.<anonymous> (http://127.0.0.1:5500/docs/bundle.js:20:23)
    at HTMLAudioElement.dispatch (https://code.jquery.com/jquery-3.1.1.slim.min.js:3:10559)
    at q.handle (https://code.jquery.com/jquery-3.1.1.slim.min.js:3:8586)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant