Joalor64GH / Arbox-WebVersion

Arbox ported to Browser or something.
https://joalor64gh.github.io/Arbox-WebVersion/
2 stars 1 forks source link

ReferenceError: Can't find variable: require #1

Open AlphaBeta906 opened 1 year ago

AlphaBeta906 commented 1 year ago

Your demo of Arbox doesn't work, and it spits out ReferenceError: Can't find variable: require. This is due to the lack of the cordova module. Might request to use Browserify.

Edit: I used Vite and miraculously it works. Will create a pull request.

AlphaBeta906 commented 1 year ago

I think I found the potential reason why it didn't work. I am using Safari, however I also use Edge. After some research I found that Safari can't decode .ogg files.

JonnycatMeow commented 1 year ago

you can use this https://github.com/chris-rudmin/opus-recorder/blob/master/example/decoder.html this works for safai decode .ogg files

AlphaBeta906 commented 1 year ago

I tried to use opus-recorder's decoder.html file but unfortunately it doesn't work. I am considering to use FFmpeg.

JonnycatMeow commented 1 year ago

@AlphaBeta906 so i found the reason for safari not working. yes ios cann't decode ogg audio files. to solve this you whould have to convert the ogg files to mp3 files. yes i know mp3 is kinda trash but its the only way its gonna work. i am going to make a pull request for it.

AlphaBeta906 commented 1 year ago

True... I have tried to convert all the ogg files to mp3s, however I would like if it would compile to mp3s on build time, or even better use FFmpeg to do it on the web without building to mp3s. I am getting really close to the end result.

JonnycatMeow commented 1 year ago

well i hope you find your answer

AlphaBeta906 commented 1 year ago

Okay I think I might've gotten really really close to getting it working. FFmpeg uses SharedArrayBuffers, which I gotten an error saying that it doesn't exist. Although caniuse.com and the Mozilla docs say otherwise. When I use it in console it also doesn't work.

AlphaBeta906 commented 1 year ago

Ok I think FFMpeg decoded the ogg, but the problem is that the game broke.