diff --git a/app.py b/app.py index b772539..76de22d 100644 --- a/app.py +++ b/app.py @@ -243,6 +243,7 @@ def route_admin_songs_new_post(): output['category_id'] = int(request.form.get('category_id')) or None output['type'] = request.form.get('type') + output['music_type'] = request.form.get('music_type') output['offset'] = float(request.form.get('offset')) or None output['skin_id'] = int(request.form.get('skin_id')) or None output['preview'] = float(request.form.get('preview')) or None @@ -303,6 +304,7 @@ def route_admin_songs_id_post(id): output['category_id'] = int(request.form.get('category_id')) or None output['type'] = request.form.get('type') + output['music_type'] = request.form.get('music_type') output['offset'] = float(request.form.get('offset')) or None output['skin_id'] = int(request.form.get('skin_id')) or None output['preview'] = float(request.form.get('preview')) or None @@ -351,9 +353,10 @@ def route_api_preview(): abort(400) song_type = song['type'] - prev_path = make_preview(song_id, song_type, song['preview']) + song_ext = song['music_type'] if song['music_type'] else "mp3" + prev_path = make_preview(song_id, song_type, song_ext, song['preview']) if not prev_path: - return redirect(get_config()['songs_baseurl'] + '%s/main.mp3' % song_id) + return redirect(get_config()['songs_baseurl'] + '%s/main.%s' % (song_id, song_ext)) return redirect(get_config()['songs_baseurl'] + '%s/preview.mp3' % song_id) @@ -606,8 +609,8 @@ def route_api_scores_get(): return jsonify({'status': 'ok', 'scores': scores, 'username': user['username'], 'display_name': user['display_name'], 'don': don}) -def make_preview(song_id, song_type, preview): - song_path = 'public/songs/%s/main.mp3' % song_id +def make_preview(song_id, song_type, song_ext, preview): + song_path = 'public/songs/%s/main.%s' % (song_id, song_ext) prev_path = 'public/songs/%s/preview.mp3' % song_id if os.path.isfile(song_path) and not os.path.isfile(prev_path): diff --git a/public/assets/audio/neiro_1_don.ogg b/public/assets/audio/neiro_1_don.ogg new file mode 100644 index 0000000..8f008e9 Binary files /dev/null and b/public/assets/audio/neiro_1_don.ogg differ diff --git a/public/assets/audio/neiro_1_don.wav b/public/assets/audio/neiro_1_don.wav deleted file mode 100644 index 4ba682e..0000000 Binary files a/public/assets/audio/neiro_1_don.wav and /dev/null differ diff --git a/public/assets/audio/neiro_1_ka.ogg b/public/assets/audio/neiro_1_ka.ogg new file mode 100644 index 0000000..1c9a619 Binary files /dev/null and b/public/assets/audio/neiro_1_ka.ogg differ diff --git a/public/assets/audio/neiro_1_ka.wav b/public/assets/audio/neiro_1_ka.wav deleted file mode 100644 index 0144f42..0000000 Binary files a/public/assets/audio/neiro_1_ka.wav and /dev/null differ diff --git a/public/assets/audio/se_balloon.ogg b/public/assets/audio/se_balloon.ogg new file mode 100644 index 0000000..a83fff0 Binary files /dev/null and b/public/assets/audio/se_balloon.ogg differ diff --git a/public/assets/audio/se_balloon.wav b/public/assets/audio/se_balloon.wav deleted file mode 100644 index 69208ef..0000000 Binary files a/public/assets/audio/se_balloon.wav and /dev/null differ diff --git a/public/assets/audio/se_calibration.ogg b/public/assets/audio/se_calibration.ogg new file mode 100644 index 0000000..51e7389 Binary files /dev/null and b/public/assets/audio/se_calibration.ogg differ diff --git a/public/assets/audio/se_calibration.wav b/public/assets/audio/se_calibration.wav deleted file mode 100644 index f1459e1..0000000 Binary files a/public/assets/audio/se_calibration.wav and /dev/null differ diff --git a/public/assets/audio/se_cancel.ogg b/public/assets/audio/se_cancel.ogg new file mode 100644 index 0000000..9c05b3f Binary files /dev/null and b/public/assets/audio/se_cancel.ogg differ diff --git a/public/assets/audio/se_cancel.wav b/public/assets/audio/se_cancel.wav deleted file mode 100644 index 69208ef..0000000 Binary files a/public/assets/audio/se_cancel.wav and /dev/null differ diff --git a/public/assets/audio/se_don.ogg b/public/assets/audio/se_don.ogg new file mode 100644 index 0000000..a903339 Binary files /dev/null and b/public/assets/audio/se_don.ogg differ diff --git a/public/assets/audio/se_don.wav b/public/assets/audio/se_don.wav deleted file mode 100644 index 4ba682e..0000000 Binary files a/public/assets/audio/se_don.wav and /dev/null differ diff --git a/public/assets/audio/se_gameclear.ogg b/public/assets/audio/se_gameclear.ogg new file mode 100644 index 0000000..b51e7ed Binary files /dev/null and b/public/assets/audio/se_gameclear.ogg differ diff --git a/public/assets/audio/se_gameclear.wav b/public/assets/audio/se_gameclear.wav deleted file mode 100644 index 69208ef..0000000 Binary files a/public/assets/audio/se_gameclear.wav and /dev/null differ diff --git a/public/assets/audio/se_gamefail.ogg b/public/assets/audio/se_gamefail.ogg new file mode 100644 index 0000000..9579458 Binary files /dev/null and b/public/assets/audio/se_gamefail.ogg differ diff --git a/public/assets/audio/se_gamefail.wav b/public/assets/audio/se_gamefail.wav deleted file mode 100644 index 69208ef..0000000 Binary files a/public/assets/audio/se_gamefail.wav and /dev/null differ diff --git a/public/assets/audio/se_gamefullcombo.ogg b/public/assets/audio/se_gamefullcombo.ogg new file mode 100644 index 0000000..741ea5a Binary files /dev/null and b/public/assets/audio/se_gamefullcombo.ogg differ diff --git a/public/assets/audio/se_gamefullcombo.wav b/public/assets/audio/se_gamefullcombo.wav deleted file mode 100644 index 69208ef..0000000 Binary files a/public/assets/audio/se_gamefullcombo.wav and /dev/null differ diff --git a/public/assets/audio/se_jump.ogg b/public/assets/audio/se_jump.ogg new file mode 100644 index 0000000..0633409 Binary files /dev/null and b/public/assets/audio/se_jump.ogg differ diff --git a/public/assets/audio/se_jump.wav b/public/assets/audio/se_jump.wav deleted file mode 100644 index 69208ef..0000000 Binary files a/public/assets/audio/se_jump.wav and /dev/null differ diff --git a/public/assets/audio/se_ka.ogg b/public/assets/audio/se_ka.ogg new file mode 100644 index 0000000..e02b656 Binary files /dev/null and b/public/assets/audio/se_ka.ogg differ diff --git a/public/assets/audio/se_ka.wav b/public/assets/audio/se_ka.wav deleted file mode 100644 index 0144f42..0000000 Binary files a/public/assets/audio/se_ka.wav and /dev/null differ diff --git a/public/assets/audio/se_pause.ogg b/public/assets/audio/se_pause.ogg new file mode 100644 index 0000000..5056bd4 Binary files /dev/null and b/public/assets/audio/se_pause.ogg differ diff --git a/public/assets/audio/se_pause.wav b/public/assets/audio/se_pause.wav deleted file mode 100644 index 69208ef..0000000 Binary files a/public/assets/audio/se_pause.wav and /dev/null differ diff --git a/public/assets/audio/se_results_countup.ogg b/public/assets/audio/se_results_countup.ogg new file mode 100644 index 0000000..ea8d017 Binary files /dev/null and b/public/assets/audio/se_results_countup.ogg differ diff --git a/public/assets/audio/se_results_countup.wav b/public/assets/audio/se_results_countup.wav deleted file mode 100644 index 69208ef..0000000 Binary files a/public/assets/audio/se_results_countup.wav and /dev/null differ diff --git a/public/assets/audio/se_results_crown.ogg b/public/assets/audio/se_results_crown.ogg new file mode 100644 index 0000000..f1807a5 Binary files /dev/null and b/public/assets/audio/se_results_crown.ogg differ diff --git a/public/assets/audio/se_results_crown.wav b/public/assets/audio/se_results_crown.wav deleted file mode 100644 index 69208ef..0000000 Binary files a/public/assets/audio/se_results_crown.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_100.ogg b/public/assets/audio/v_combo_100.ogg new file mode 100644 index 0000000..72ebbb3 Binary files /dev/null and b/public/assets/audio/v_combo_100.ogg differ diff --git a/public/assets/audio/v_combo_100.wav b/public/assets/audio/v_combo_100.wav deleted file mode 100644 index 2636bef..0000000 Binary files a/public/assets/audio/v_combo_100.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_1000.ogg b/public/assets/audio/v_combo_1000.ogg new file mode 100644 index 0000000..1a53c6e Binary files /dev/null and b/public/assets/audio/v_combo_1000.ogg differ diff --git a/public/assets/audio/v_combo_1000.wav b/public/assets/audio/v_combo_1000.wav deleted file mode 100644 index ae8127d..0000000 Binary files a/public/assets/audio/v_combo_1000.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_1100.ogg b/public/assets/audio/v_combo_1100.ogg new file mode 100644 index 0000000..f43fefb Binary files /dev/null and b/public/assets/audio/v_combo_1100.ogg differ diff --git a/public/assets/audio/v_combo_1100.wav b/public/assets/audio/v_combo_1100.wav deleted file mode 100644 index 616058c..0000000 Binary files a/public/assets/audio/v_combo_1100.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_1200.ogg b/public/assets/audio/v_combo_1200.ogg new file mode 100644 index 0000000..24603cb Binary files /dev/null and b/public/assets/audio/v_combo_1200.ogg differ diff --git a/public/assets/audio/v_combo_1200.wav b/public/assets/audio/v_combo_1200.wav deleted file mode 100644 index ac68af2..0000000 Binary files a/public/assets/audio/v_combo_1200.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_1300.ogg b/public/assets/audio/v_combo_1300.ogg new file mode 100644 index 0000000..6014aef Binary files /dev/null and b/public/assets/audio/v_combo_1300.ogg differ diff --git a/public/assets/audio/v_combo_1300.wav b/public/assets/audio/v_combo_1300.wav deleted file mode 100644 index 1d2d4b4..0000000 Binary files a/public/assets/audio/v_combo_1300.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_1400.ogg b/public/assets/audio/v_combo_1400.ogg new file mode 100644 index 0000000..40b4f99 Binary files /dev/null and b/public/assets/audio/v_combo_1400.ogg differ diff --git a/public/assets/audio/v_combo_1400.wav b/public/assets/audio/v_combo_1400.wav deleted file mode 100644 index 4ea2511..0000000 Binary files a/public/assets/audio/v_combo_1400.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_1500.ogg b/public/assets/audio/v_combo_1500.ogg new file mode 100644 index 0000000..48ee585 Binary files /dev/null and b/public/assets/audio/v_combo_1500.ogg differ diff --git a/public/assets/audio/v_combo_1500.wav b/public/assets/audio/v_combo_1500.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_1500.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_1600.ogg b/public/assets/audio/v_combo_1600.ogg new file mode 100644 index 0000000..94749d5 Binary files /dev/null and b/public/assets/audio/v_combo_1600.ogg differ diff --git a/public/assets/audio/v_combo_1600.wav b/public/assets/audio/v_combo_1600.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_1600.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_1700.ogg b/public/assets/audio/v_combo_1700.ogg new file mode 100644 index 0000000..e66f250 Binary files /dev/null and b/public/assets/audio/v_combo_1700.ogg differ diff --git a/public/assets/audio/v_combo_1700.wav b/public/assets/audio/v_combo_1700.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_1700.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_1800.ogg b/public/assets/audio/v_combo_1800.ogg new file mode 100644 index 0000000..29b12c3 Binary files /dev/null and b/public/assets/audio/v_combo_1800.ogg differ diff --git a/public/assets/audio/v_combo_1800.wav b/public/assets/audio/v_combo_1800.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_1800.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_1900.ogg b/public/assets/audio/v_combo_1900.ogg new file mode 100644 index 0000000..6607767 Binary files /dev/null and b/public/assets/audio/v_combo_1900.ogg differ diff --git a/public/assets/audio/v_combo_1900.wav b/public/assets/audio/v_combo_1900.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_1900.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_200.ogg b/public/assets/audio/v_combo_200.ogg new file mode 100644 index 0000000..687f93e Binary files /dev/null and b/public/assets/audio/v_combo_200.ogg differ diff --git a/public/assets/audio/v_combo_200.wav b/public/assets/audio/v_combo_200.wav deleted file mode 100644 index 99a29ef..0000000 Binary files a/public/assets/audio/v_combo_200.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_2000.ogg b/public/assets/audio/v_combo_2000.ogg new file mode 100644 index 0000000..8461bc9 Binary files /dev/null and b/public/assets/audio/v_combo_2000.ogg differ diff --git a/public/assets/audio/v_combo_2000.wav b/public/assets/audio/v_combo_2000.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_2000.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_2100.ogg b/public/assets/audio/v_combo_2100.ogg new file mode 100644 index 0000000..ce429cd Binary files /dev/null and b/public/assets/audio/v_combo_2100.ogg differ diff --git a/public/assets/audio/v_combo_2100.wav b/public/assets/audio/v_combo_2100.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_2100.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_2200.ogg b/public/assets/audio/v_combo_2200.ogg new file mode 100644 index 0000000..4bb5b74 Binary files /dev/null and b/public/assets/audio/v_combo_2200.ogg differ diff --git a/public/assets/audio/v_combo_2200.wav b/public/assets/audio/v_combo_2200.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_2200.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_2300.ogg b/public/assets/audio/v_combo_2300.ogg new file mode 100644 index 0000000..5b5dc82 Binary files /dev/null and b/public/assets/audio/v_combo_2300.ogg differ diff --git a/public/assets/audio/v_combo_2300.wav b/public/assets/audio/v_combo_2300.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_2300.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_2400.ogg b/public/assets/audio/v_combo_2400.ogg new file mode 100644 index 0000000..1d5313b Binary files /dev/null and b/public/assets/audio/v_combo_2400.ogg differ diff --git a/public/assets/audio/v_combo_2400.wav b/public/assets/audio/v_combo_2400.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_2400.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_2500.ogg b/public/assets/audio/v_combo_2500.ogg new file mode 100644 index 0000000..3e67756 Binary files /dev/null and b/public/assets/audio/v_combo_2500.ogg differ diff --git a/public/assets/audio/v_combo_2500.wav b/public/assets/audio/v_combo_2500.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_2500.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_2600.ogg b/public/assets/audio/v_combo_2600.ogg new file mode 100644 index 0000000..f7ffdad Binary files /dev/null and b/public/assets/audio/v_combo_2600.ogg differ diff --git a/public/assets/audio/v_combo_2600.wav b/public/assets/audio/v_combo_2600.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_2600.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_2700.ogg b/public/assets/audio/v_combo_2700.ogg new file mode 100644 index 0000000..da57cd7 Binary files /dev/null and b/public/assets/audio/v_combo_2700.ogg differ diff --git a/public/assets/audio/v_combo_2700.wav b/public/assets/audio/v_combo_2700.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_2700.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_2800.ogg b/public/assets/audio/v_combo_2800.ogg new file mode 100644 index 0000000..45b1f18 Binary files /dev/null and b/public/assets/audio/v_combo_2800.ogg differ diff --git a/public/assets/audio/v_combo_2800.wav b/public/assets/audio/v_combo_2800.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_2800.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_2900.ogg b/public/assets/audio/v_combo_2900.ogg new file mode 100644 index 0000000..22a92a3 Binary files /dev/null and b/public/assets/audio/v_combo_2900.ogg differ diff --git a/public/assets/audio/v_combo_2900.wav b/public/assets/audio/v_combo_2900.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_2900.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_300.ogg b/public/assets/audio/v_combo_300.ogg new file mode 100644 index 0000000..9fba4cc Binary files /dev/null and b/public/assets/audio/v_combo_300.ogg differ diff --git a/public/assets/audio/v_combo_300.wav b/public/assets/audio/v_combo_300.wav deleted file mode 100644 index c5809c7..0000000 Binary files a/public/assets/audio/v_combo_300.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_3000.ogg b/public/assets/audio/v_combo_3000.ogg new file mode 100644 index 0000000..696eccd Binary files /dev/null and b/public/assets/audio/v_combo_3000.ogg differ diff --git a/public/assets/audio/v_combo_3000.wav b/public/assets/audio/v_combo_3000.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_3000.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_3100.ogg b/public/assets/audio/v_combo_3100.ogg new file mode 100644 index 0000000..245d148 Binary files /dev/null and b/public/assets/audio/v_combo_3100.ogg differ diff --git a/public/assets/audio/v_combo_3100.wav b/public/assets/audio/v_combo_3100.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_3100.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_3200.ogg b/public/assets/audio/v_combo_3200.ogg new file mode 100644 index 0000000..a0f9365 Binary files /dev/null and b/public/assets/audio/v_combo_3200.ogg differ diff --git a/public/assets/audio/v_combo_3200.wav b/public/assets/audio/v_combo_3200.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_3200.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_3300.ogg b/public/assets/audio/v_combo_3300.ogg new file mode 100644 index 0000000..6f884ae Binary files /dev/null and b/public/assets/audio/v_combo_3300.ogg differ diff --git a/public/assets/audio/v_combo_3300.wav b/public/assets/audio/v_combo_3300.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_3300.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_3400.ogg b/public/assets/audio/v_combo_3400.ogg new file mode 100644 index 0000000..56dcf08 Binary files /dev/null and b/public/assets/audio/v_combo_3400.ogg differ diff --git a/public/assets/audio/v_combo_3400.wav b/public/assets/audio/v_combo_3400.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_3400.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_3500.ogg b/public/assets/audio/v_combo_3500.ogg new file mode 100644 index 0000000..7357048 Binary files /dev/null and b/public/assets/audio/v_combo_3500.ogg differ diff --git a/public/assets/audio/v_combo_3500.wav b/public/assets/audio/v_combo_3500.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_3500.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_3600.ogg b/public/assets/audio/v_combo_3600.ogg new file mode 100644 index 0000000..9a88e7e Binary files /dev/null and b/public/assets/audio/v_combo_3600.ogg differ diff --git a/public/assets/audio/v_combo_3600.wav b/public/assets/audio/v_combo_3600.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_3600.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_3700.ogg b/public/assets/audio/v_combo_3700.ogg new file mode 100644 index 0000000..e341d24 Binary files /dev/null and b/public/assets/audio/v_combo_3700.ogg differ diff --git a/public/assets/audio/v_combo_3700.wav b/public/assets/audio/v_combo_3700.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_3700.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_3800.ogg b/public/assets/audio/v_combo_3800.ogg new file mode 100644 index 0000000..07cabf7 Binary files /dev/null and b/public/assets/audio/v_combo_3800.ogg differ diff --git a/public/assets/audio/v_combo_3800.wav b/public/assets/audio/v_combo_3800.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_3800.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_3900.ogg b/public/assets/audio/v_combo_3900.ogg new file mode 100644 index 0000000..b77dd05 Binary files /dev/null and b/public/assets/audio/v_combo_3900.ogg differ diff --git a/public/assets/audio/v_combo_3900.wav b/public/assets/audio/v_combo_3900.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_3900.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_400.ogg b/public/assets/audio/v_combo_400.ogg new file mode 100644 index 0000000..9604ecc Binary files /dev/null and b/public/assets/audio/v_combo_400.ogg differ diff --git a/public/assets/audio/v_combo_400.wav b/public/assets/audio/v_combo_400.wav deleted file mode 100644 index d76bf6a..0000000 Binary files a/public/assets/audio/v_combo_400.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_4000.ogg b/public/assets/audio/v_combo_4000.ogg new file mode 100644 index 0000000..248400c Binary files /dev/null and b/public/assets/audio/v_combo_4000.ogg differ diff --git a/public/assets/audio/v_combo_4000.wav b/public/assets/audio/v_combo_4000.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_4000.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_4100.ogg b/public/assets/audio/v_combo_4100.ogg new file mode 100644 index 0000000..c89e582 Binary files /dev/null and b/public/assets/audio/v_combo_4100.ogg differ diff --git a/public/assets/audio/v_combo_4100.wav b/public/assets/audio/v_combo_4100.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_4100.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_4200.ogg b/public/assets/audio/v_combo_4200.ogg new file mode 100644 index 0000000..68331a4 Binary files /dev/null and b/public/assets/audio/v_combo_4200.ogg differ diff --git a/public/assets/audio/v_combo_4200.wav b/public/assets/audio/v_combo_4200.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_4200.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_4300.ogg b/public/assets/audio/v_combo_4300.ogg new file mode 100644 index 0000000..152260d Binary files /dev/null and b/public/assets/audio/v_combo_4300.ogg differ diff --git a/public/assets/audio/v_combo_4300.wav b/public/assets/audio/v_combo_4300.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_4300.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_4400.ogg b/public/assets/audio/v_combo_4400.ogg new file mode 100644 index 0000000..851e611 Binary files /dev/null and b/public/assets/audio/v_combo_4400.ogg differ diff --git a/public/assets/audio/v_combo_4400.wav b/public/assets/audio/v_combo_4400.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_4400.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_4500.ogg b/public/assets/audio/v_combo_4500.ogg new file mode 100644 index 0000000..cec53ae Binary files /dev/null and b/public/assets/audio/v_combo_4500.ogg differ diff --git a/public/assets/audio/v_combo_4500.wav b/public/assets/audio/v_combo_4500.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_4500.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_4600.ogg b/public/assets/audio/v_combo_4600.ogg new file mode 100644 index 0000000..3cc8f57 Binary files /dev/null and b/public/assets/audio/v_combo_4600.ogg differ diff --git a/public/assets/audio/v_combo_4600.wav b/public/assets/audio/v_combo_4600.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_4600.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_4700.ogg b/public/assets/audio/v_combo_4700.ogg new file mode 100644 index 0000000..5f308d0 Binary files /dev/null and b/public/assets/audio/v_combo_4700.ogg differ diff --git a/public/assets/audio/v_combo_4700.wav b/public/assets/audio/v_combo_4700.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_4700.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_4800.ogg b/public/assets/audio/v_combo_4800.ogg new file mode 100644 index 0000000..b7397f1 Binary files /dev/null and b/public/assets/audio/v_combo_4800.ogg differ diff --git a/public/assets/audio/v_combo_4800.wav b/public/assets/audio/v_combo_4800.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_4800.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_4900.ogg b/public/assets/audio/v_combo_4900.ogg new file mode 100644 index 0000000..aa9939b Binary files /dev/null and b/public/assets/audio/v_combo_4900.ogg differ diff --git a/public/assets/audio/v_combo_4900.wav b/public/assets/audio/v_combo_4900.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_4900.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_50.ogg b/public/assets/audio/v_combo_50.ogg new file mode 100644 index 0000000..677c582 Binary files /dev/null and b/public/assets/audio/v_combo_50.ogg differ diff --git a/public/assets/audio/v_combo_50.wav b/public/assets/audio/v_combo_50.wav deleted file mode 100644 index 1fb3c2b..0000000 Binary files a/public/assets/audio/v_combo_50.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_500.ogg b/public/assets/audio/v_combo_500.ogg new file mode 100644 index 0000000..b95aa41 Binary files /dev/null and b/public/assets/audio/v_combo_500.ogg differ diff --git a/public/assets/audio/v_combo_500.wav b/public/assets/audio/v_combo_500.wav deleted file mode 100644 index 17bd25e..0000000 Binary files a/public/assets/audio/v_combo_500.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_5000.ogg b/public/assets/audio/v_combo_5000.ogg new file mode 100644 index 0000000..85cae53 Binary files /dev/null and b/public/assets/audio/v_combo_5000.ogg differ diff --git a/public/assets/audio/v_combo_5000.wav b/public/assets/audio/v_combo_5000.wav deleted file mode 100644 index a5034f1..0000000 Binary files a/public/assets/audio/v_combo_5000.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_600.ogg b/public/assets/audio/v_combo_600.ogg new file mode 100644 index 0000000..35e132f Binary files /dev/null and b/public/assets/audio/v_combo_600.ogg differ diff --git a/public/assets/audio/v_combo_600.wav b/public/assets/audio/v_combo_600.wav deleted file mode 100644 index f57f443..0000000 Binary files a/public/assets/audio/v_combo_600.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_700.ogg b/public/assets/audio/v_combo_700.ogg new file mode 100644 index 0000000..ed9e391 Binary files /dev/null and b/public/assets/audio/v_combo_700.ogg differ diff --git a/public/assets/audio/v_combo_700.wav b/public/assets/audio/v_combo_700.wav deleted file mode 100644 index b23db58..0000000 Binary files a/public/assets/audio/v_combo_700.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_800.ogg b/public/assets/audio/v_combo_800.ogg new file mode 100644 index 0000000..0eb5e72 Binary files /dev/null and b/public/assets/audio/v_combo_800.ogg differ diff --git a/public/assets/audio/v_combo_800.wav b/public/assets/audio/v_combo_800.wav deleted file mode 100644 index 84fad8a..0000000 Binary files a/public/assets/audio/v_combo_800.wav and /dev/null differ diff --git a/public/assets/audio/v_combo_900.ogg b/public/assets/audio/v_combo_900.ogg new file mode 100644 index 0000000..4331b43 Binary files /dev/null and b/public/assets/audio/v_combo_900.ogg differ diff --git a/public/assets/audio/v_combo_900.wav b/public/assets/audio/v_combo_900.wav deleted file mode 100644 index 86ca70b..0000000 Binary files a/public/assets/audio/v_combo_900.wav and /dev/null differ diff --git a/public/assets/audio/v_diffsel.ogg b/public/assets/audio/v_diffsel.ogg new file mode 100644 index 0000000..fa8e01f Binary files /dev/null and b/public/assets/audio/v_diffsel.ogg differ diff --git a/public/assets/audio/v_diffsel.wav b/public/assets/audio/v_diffsel.wav deleted file mode 100644 index b31cec6..0000000 Binary files a/public/assets/audio/v_diffsel.wav and /dev/null differ diff --git a/public/assets/audio/v_fullcombo.ogg b/public/assets/audio/v_fullcombo.ogg new file mode 100644 index 0000000..0779a4a Binary files /dev/null and b/public/assets/audio/v_fullcombo.ogg differ diff --git a/public/assets/audio/v_fullcombo.wav b/public/assets/audio/v_fullcombo.wav deleted file mode 100644 index 33cdd5f..0000000 Binary files a/public/assets/audio/v_fullcombo.wav and /dev/null differ diff --git a/public/assets/audio/v_renda.ogg b/public/assets/audio/v_renda.ogg new file mode 100644 index 0000000..0810d57 Binary files /dev/null and b/public/assets/audio/v_renda.ogg differ diff --git a/public/assets/audio/v_renda.wav b/public/assets/audio/v_renda.wav deleted file mode 100644 index d8a03c6..0000000 Binary files a/public/assets/audio/v_renda.wav and /dev/null differ diff --git a/public/assets/audio/v_results.ogg b/public/assets/audio/v_results.ogg new file mode 100644 index 0000000..3f4094b Binary files /dev/null and b/public/assets/audio/v_results.ogg differ diff --git a/public/assets/audio/v_results.wav b/public/assets/audio/v_results.wav deleted file mode 100644 index b572b17..0000000 Binary files a/public/assets/audio/v_results.wav and /dev/null differ diff --git a/public/assets/audio/v_results_fullcombo.ogg b/public/assets/audio/v_results_fullcombo.ogg new file mode 100644 index 0000000..375b7fb Binary files /dev/null and b/public/assets/audio/v_results_fullcombo.ogg differ diff --git a/public/assets/audio/v_results_fullcombo.wav b/public/assets/audio/v_results_fullcombo.wav deleted file mode 100644 index 0d49779..0000000 Binary files a/public/assets/audio/v_results_fullcombo.wav and /dev/null differ diff --git a/public/assets/audio/v_results_fullcombo2.ogg b/public/assets/audio/v_results_fullcombo2.ogg new file mode 100644 index 0000000..d0ee180 Binary files /dev/null and b/public/assets/audio/v_results_fullcombo2.ogg differ diff --git a/public/assets/audio/v_results_fullcombo2.wav b/public/assets/audio/v_results_fullcombo2.wav deleted file mode 100644 index 0d49779..0000000 Binary files a/public/assets/audio/v_results_fullcombo2.wav and /dev/null differ diff --git a/public/assets/audio/v_sanka.ogg b/public/assets/audio/v_sanka.ogg new file mode 100644 index 0000000..f3bceac Binary files /dev/null and b/public/assets/audio/v_sanka.ogg differ diff --git a/public/assets/audio/v_sanka.wav b/public/assets/audio/v_sanka.wav deleted file mode 100644 index c7072d6..0000000 Binary files a/public/assets/audio/v_sanka.wav and /dev/null differ diff --git a/public/assets/audio/v_songsel.ogg b/public/assets/audio/v_songsel.ogg new file mode 100644 index 0000000..c34c467 Binary files /dev/null and b/public/assets/audio/v_songsel.ogg differ diff --git a/public/assets/audio/v_songsel.wav b/public/assets/audio/v_songsel.wav deleted file mode 100644 index 9f56c5a..0000000 Binary files a/public/assets/audio/v_songsel.wav and /dev/null differ diff --git a/public/assets/audio/v_start.ogg b/public/assets/audio/v_start.ogg new file mode 100644 index 0000000..b7c8880 Binary files /dev/null and b/public/assets/audio/v_start.ogg differ diff --git a/public/assets/audio/v_start.wav b/public/assets/audio/v_start.wav deleted file mode 100644 index 5c6e6e7..0000000 Binary files a/public/assets/audio/v_start.wav and /dev/null differ diff --git a/public/assets/audio/v_title.ogg b/public/assets/audio/v_title.ogg new file mode 100644 index 0000000..b1fb5ec Binary files /dev/null and b/public/assets/audio/v_title.ogg differ diff --git a/public/assets/audio/v_title.wav b/public/assets/audio/v_title.wav deleted file mode 100644 index c37b862..0000000 Binary files a/public/assets/audio/v_title.wav and /dev/null differ diff --git a/public/src/js/account.js b/public/src/js/account.js index 0c110ff..7080ec3 100644 --- a/public/src/js/account.js +++ b/public/src/js/account.js @@ -59,12 +59,12 @@ class Account{ this.customdonBodyFill.value = account.don.body_fill var parent = this.customdonBodyFill.parentNode parent.insertBefore(document.createTextNode(strings.account.customdon.bodyFill), parent.firstChild) - pageEvents.add(this.customdonBodyFill, "change", this.customdonChange.bind(this)) + pageEvents.add(this.customdonBodyFill, ["change", "input"], this.customdonChange.bind(this)) this.customdonFaceFill = this.getElement("customdon-facefill") this.customdonFaceFill.value = account.don.face_fill var parent = this.customdonFaceFill.parentNode parent.insertBefore(document.createTextNode(strings.account.customdon.faceFill), parent.firstChild) - pageEvents.add(this.customdonFaceFill, "change", this.customdonChange.bind(this)) + pageEvents.add(this.customdonFaceFill, ["change", "input"], this.customdonChange.bind(this)) this.customdonResetBtn = this.getElement("customdon-reset") this.customdonResetBtn.value = strings.account.customdon.reset pageEvents.add(this.customdonResetBtn, ["click", "touchstart"], this.customdonReset.bind(this)) @@ -578,8 +578,8 @@ class Account{ } this.redrawRunning = false this.customdonCache.clean() - pageEvents.remove(this.customdonBodyFill, "change") - pageEvents.remove(this.customdonFaceFill, "change") + pageEvents.remove(this.customdonBodyFill, ["change", "input"]) + pageEvents.remove(this.customdonFaceFill, ["change", "input"]) pageEvents.remove(this.customdonResetBtn, ["click", "touchstart"]) pageEvents.remove(this.accounPassButton, ["click", "touchstart"]) pageEvents.remove(this.accountDelButton, ["click", "touchstart"]) diff --git a/public/src/js/assets.js b/public/src/js/assets.js index 9a0ef01..c8b23cb 100644 --- a/public/src/js/assets.js +++ b/public/src/js/assets.js @@ -93,37 +93,37 @@ var assets = { "settings_gamepad.png" ], "audioSfx": [ - "se_pause.wav", - "se_calibration.wav", - - "v_results.wav", - "v_sanka.wav", - "v_songsel.wav", - "v_start.wav", - "v_title.wav" + "se_pause.ogg", + "se_calibration.ogg", + + "v_results.ogg", + "v_sanka.ogg", + "v_songsel.ogg", + "v_start.ogg", + "v_title.ogg" ], "audioSfxLR": [ - "neiro_1_don.wav", - "neiro_1_ka.wav", - "se_cancel.wav", - "se_don.wav", - "se_ka.wav", - "se_jump.wav", - - "se_balloon.wav", - "se_gameclear.wav", - "se_gamefail.wav", - "se_gamefullcombo.wav", - "se_results_countup.wav", - "se_results_crown.wav", - - "v_fullcombo.wav", - "v_renda.wav", - "v_results_fullcombo.wav", - "v_results_fullcombo2.wav" + "neiro_1_don.ogg", + "neiro_1_ka.ogg", + "se_cancel.ogg", + "se_don.ogg", + "se_ka.ogg", + "se_jump.ogg", + + "se_balloon.ogg", + "se_gameclear.ogg", + "se_gamefail.ogg", + "se_gamefullcombo.ogg", + "se_results_countup.ogg", + "se_results_crown.ogg", + + "v_fullcombo.ogg", + "v_renda.ogg", + "v_results_fullcombo.ogg", + "v_results_fullcombo2.ogg" ], "audioSfxLoud": [ - "v_diffsel.wav" + "v_diffsel.ogg" ], "audioMusic": [ "bgm_songsel.mp3", diff --git a/public/src/js/controller.js b/public/src/js/controller.js index 645012a..3433069 100644 --- a/public/src/js/controller.js +++ b/public/src/js/controller.js @@ -48,7 +48,7 @@ class Controller{ comboVoices.forEach(name => { if (!assets.sounds[name + "_p1"]) { - promises.push(loader.loadSound(name + ".wav", snd.sfxGain).then(sound => { + promises.push(loader.loadSound(name + ".ogg", snd.sfxGain).then(sound => { assets.sounds[name + "_p1"] = assets.sounds[name].copy(snd.sfxGainL) assets.sounds[name + "_p2"] = assets.sounds[name].copy(snd.sfxGainR) })) @@ -246,7 +246,12 @@ class Controller{ var songObj = assets.songs.find(song => song.id === this.selectedSong.folder) var promises = [] if(songObj.chart && songObj.chart !== "blank"){ - promises.push(songObj.chart.read(this.selectedSong.type === "tja" ? "sjis" : undefined).then(data => { + var chart = songObj.chart + if(chart.separateDiff){ + var chartDiff = this.selectedSong.difficulty + chart = chart[chartDiff] + } + promises.push(chart.read(this.selectedSong.type === "tja" ? "sjis" : undefined).then(data => { this.songData = data.replace(/\0/g, "").split("\n") return Promise.resolve() })) diff --git a/public/src/js/customsongs.js b/public/src/js/customsongs.js index d985c24..e20eb2d 100644 --- a/public/src/js/customsongs.js +++ b/public/src/js/customsongs.js @@ -19,7 +19,7 @@ class CustomSongs{ this.items = [] this.linkLocalFolder = document.getElementById("link-localfolder") - this.hasLocal = "webkitdirectory" in HTMLInputElement.prototype && !(/Android/.test(navigator.userAgent)) + this.hasLocal = "webkitdirectory" in HTMLInputElement.prototype && !(/Android|iPhone|iPad/.test(navigator.userAgent)) if(this.hasLocal){ this.browse = document.getElementById("browse") pageEvents.add(this.browse, "change", this.browseChange.bind(this)) diff --git a/public/src/js/lib/oggmented-wasm.js b/public/src/js/lib/oggmented-wasm.js new file mode 100644 index 0000000..f10dc7b --- /dev/null +++ b/public/src/js/lib/oggmented-wasm.js @@ -0,0 +1,46 @@ + +var Oggmented = (function() { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + + return ( +function(Oggmented) { + Oggmented = Oggmented || {}; + +(function(b,c){function m(h){delete k[h]}function l(h){if(e)setTimeout(l,0,h);else{var t=k[h];if(t){e=!0;try{var p=t.A,y=t.v;switch(y.length){case 0:p();break;case 1:p(y[0]);break;case 2:p(y[0],y[1]);break;case 3:p(y[0],y[1],y[2]);break;default:p.apply(c,y)}}finally{m(h),e=!1}}}}function q(){r=function(h){process.C(function(){l(h)})}}function u(){if(b.postMessage&&!b.importScripts){var h=!0,t=b.onmessage;b.onmessage=function(){h=!1};b.postMessage("","*");b.onmessage=t;return h}}function w(){function h(p){p.source=== +b&&"string"===typeof p.data&&0===p.data.indexOf(t)&&l(+p.data.slice(t.length))}var t="setImmediate$"+Math.random()+"$";b.addEventListener?b.addEventListener("message",h,!1):b.attachEvent("onmessage",h);r=function(p){b.postMessage(t+p,"*")}}function v(){var h=new MessageChannel;h.port1.onmessage=function(t){l(t.data)};r=function(t){h.port2.postMessage(t)}}function A(){var h=f.documentElement;r=function(t){var p=f.createElement("script");p.onreadystatechange=function(){l(t);p.onreadystatechange=null; +h.removeChild(p);p=null};h.appendChild(p)}}function d(){r=function(h){setTimeout(l,0,h)}}if(!b.setImmediate){var g=1,k={},e=!1,f=b.document,r,n=Object.getPrototypeOf&&Object.getPrototypeOf(b);n=n&&n.setTimeout?n:b;"[object process]"==={}.toString.call(b.process)?q():u()?w():b.MessageChannel?v():f&&"onreadystatechange"in f.createElement("script")?A():d();n.setImmediate=function(h){"function"!==typeof h&&(h=new Function(""+h));for(var t=Array(arguments.length-1),p=0;p{try{var {channels:l,length:q,rate:u}=(g=>{const k=g.byteLength,e=B(k);g=new Int8Array(g);C.set(g,e);D("open_buffer","number",["number","number"],[e,k]);return{channels:ba(),length:ca(),rate:da()}})(b),w=aa.createBuffer(l,q,u),v=B(Uint32Array.BYTES_PER_ELEMENT),A=0}catch(g){return m&&m(g)}const d=()=>{try{const g=Date.now();let k;for(;k=ea(v);){const e=fa(v,"*"),f=new Uint32Array(ha.buffer,e,l);for(let r=0;r>0];case "i8":return C[b>>0];case "i16":return ka[b>>1];case "i32":return M[b>>2];case "i64":return M[b>>2];case "float":return E[b>>2];case "double":return la[b>>3];default:L("invalid type for getValue: "+c)}return null}var N,O=!1;function ma(b){var c=a["_"+b];c||L("Assertion failed: Cannot call unknown function "+(b+", make sure it is exported"));return c} +function D(b,c,m,l){var q={string:function(d){var g=0;if(null!==d&&void 0!==d&&0!==d){var k=(d.length<<2)+1;g=P(k);var e=g,f=Q;if(0=n){var h=d.charCodeAt(++r);n=65536+((n&1023)<<10)|h&1023}if(127>=n){if(e>=k)break;f[e++]=n}else{if(2047>=n){if(e+1>=k)break;f[e++]=192|n>>6}else{if(65535>=n){if(e+2>=k)break;f[e++]=224|n>>12}else{if(e+3>=k)break;f[e++]=240|n>>18;f[e++]=128|n>>12&63}f[e++]=128|n>>6&63}f[e++]=128|n&63}}f[e]= +0}}return g},array:function(d){var g=P(d.length);C.set(d,g);return g}},u=ma(b),w=[];b=0;if(l)for(var v=0;v=k);)++e;if(16f?k+=String.fromCharCode(f):(f-=65536,k+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else k+=String.fromCharCode(f)}d=k}}else d="";else d="boolean"===c?!!d:d;return d}(m);0!==b&&pa(b);return m}var oa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0,R,C,Q,ka,M,ha,E,la; +function qa(b){R=b;a.HEAP8=C=new Int8Array(b);a.HEAP16=ka=new Int16Array(b);a.HEAP32=M=new Int32Array(b);a.HEAPU8=Q=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=ha=new Uint32Array(b);a.HEAPF32=E=new Float32Array(b);a.HEAPF64=la=new Float64Array(b)}var ra=a.INITIAL_MEMORY||16777216;a.wasmMemory?N=a.wasmMemory:N=new WebAssembly.Memory({initial:ra/65536,maximum:32768});N&&(R=N.buffer);ra=R.byteLength;qa(R);var S,sa=[],ta=[],ua=[],va=[];function wa(){var b=a.preRun.shift();sa.unshift(b)} +var T=0,U=null,V=null;a.preloadedImages={};a.preloadedAudios={};function L(b){if(a.onAbort)a.onAbort(b);J(b);O=!0;b=new WebAssembly.RuntimeError("abort("+b+"). Build with -s ASSERTIONS=1 for more info.");z(b);throw b;}function xa(){var b=W;return String.prototype.startsWith?b.startsWith("data:application/octet-stream;base64,"):0===b.indexOf("data:application/octet-stream;base64,")}var W="oggmented-wasm.wasm";if(!xa()){var ya=W;W=a.locateFile?a.locateFile(ya,I):I+ya} +function za(){try{if(K)return new Uint8Array(K);throw"both async and sync fetching of the wasm failed";}catch(b){L(b)}}function Aa(){return K||"function"!==typeof fetch?Promise.resolve().then(za):fetch(W,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+W+"'";return b.arrayBuffer()}).catch(function(){return za()})} +function X(b){for(;0>>=0;var c=Q.length;if(2147483648=m;m*=2){var l=c*(1+.2/m);l=Math.min(l,b+100663296);l=Math.max(16777216,b,l);0>>16);qa(N.buffer);var q=1;break a}catch(u){}q=void 0}if(q)return!0}return!1},d:function(b){if(!noExitRuntime){if(a.onExit)a.onExit(b);O=!0}ja(b,new Ca(b))},a:N}; +(function(){function b(q){a.asm=q.exports;S=a.asm.e;T--;a.monitorRunDependencies&&a.monitorRunDependencies(T);0==T&&(null!==U&&(clearInterval(U),U=null),V&&(q=V,V=null,q()))}function c(q){b(q.instance)}function m(q){return Aa().then(function(u){return WebAssembly.instantiate(u,l)}).then(q,function(u){J("failed to asynchronously prepare wasm: "+u);L(u)})}var l={a:Da};T++;a.monitorRunDependencies&&a.monitorRunDependencies(T);if(a.instantiateWasm)try{return a.instantiateWasm(l,b)}catch(q){return J("Module.instantiateWasm callback failed with error: "+ +q),!1}(function(){return K||"function"!==typeof WebAssembly.instantiateStreaming||xa()||"function"!==typeof fetch?m(c):fetch(W,{credentials:"same-origin"}).then(function(q){return WebAssembly.instantiateStreaming(q,l).then(c,function(u){J("wasm streaming compile failed: "+u);J("falling back to ArrayBuffer instantiation");return m(c)})})})().catch(z);return{}})();var Ba=a.___wasm_call_ctors=function(){return(Ba=a.___wasm_call_ctors=a.asm.f).apply(null,arguments)}; +a._open_buffer=function(){return(a._open_buffer=a.asm.g).apply(null,arguments)};var ia=a._close_buffer=function(){return(ia=a._close_buffer=a.asm.h).apply(null,arguments)},ca=a._get_length=function(){return(ca=a._get_length=a.asm.i).apply(null,arguments)},ba=a._get_channels=function(){return(ba=a._get_channels=a.asm.j).apply(null,arguments)},da=a._get_rate=function(){return(da=a._get_rate=a.asm.k).apply(null,arguments)};a._get_time=function(){return(a._get_time=a.asm.l).apply(null,arguments)}; +a._get_streams=function(){return(a._get_streams=a.asm.m).apply(null,arguments)}; +var ea=a._read_float=function(){return(ea=a._read_float=a.asm.n).apply(null,arguments)},F=a._free=function(){return(F=a._free=a.asm.o).apply(null,arguments)},B=a._malloc=function(){return(B=a._malloc=a.asm.p).apply(null,arguments)},na=a.stackSave=function(){return(na=a.stackSave=a.asm.q).apply(null,arguments)},pa=a.stackRestore=function(){return(pa=a.stackRestore=a.asm.r).apply(null,arguments)},P=a.stackAlloc=function(){return(P=a.stackAlloc=a.asm.s).apply(null,arguments)};a.ccall=D;a.getValue=fa; +var Y;function Ca(b){this.name="ExitStatus";this.message="Program terminated with exit("+b+")";this.status=b}V=function Ea(){Y||Z();Y||(V=Ea)}; +function Z(){function b(){if(!Y&&(Y=!0,a.calledRun=!0,!O)){X(ta);X(ua);x(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();va.unshift(c)}X(va)}}if(!(0 { this.addPromise(this.loadScript("/src/js/" + name), "/src/js/" + name) }) @@ -144,7 +148,8 @@ class Loader{ songs = JSON.parse(songs) songs.forEach(song => { var directory = gameConfig.songs_baseurl + song.id + "/" - song.music = new RemoteFile(directory + "main.mp3") + var songExt = song.music_type ? song.music_type : "mp3" + song.music = new RemoteFile(directory + "main." + songExt) if(song.type === "tja"){ song.chart = new RemoteFile(directory + "main.tja") }else{ @@ -185,6 +190,9 @@ class Loader{ this.addPromise(Promise.all(categoryPromises)) snd.buffer = new SoundBuffer() + if(!oggSupport){ + snd.buffer.oggDecoder = snd.buffer.fallbackDecoder + } snd.musicGain = snd.buffer.createGain() snd.sfxGain = snd.buffer.createGain() snd.previewGain = snd.buffer.createGain() diff --git a/public/src/js/loadsong.js b/public/src/js/loadsong.js index 66b9080..bcf462f 100644 --- a/public/src/js/loadsong.js +++ b/public/src/js/loadsong.js @@ -126,7 +126,7 @@ class LoadSong{ }), songObj.music.url) } var chart = songObj.chart - if(chart.separateDiff){ + if(chart && chart.separateDiff){ var chartDiff = this.selectedSong.difficulty chart = chart[chartDiff] } diff --git a/public/src/js/songselect.js b/public/src/js/songselect.js index 409f291..83e51e6 100644 --- a/public/src/js/songselect.js +++ b/public/src/js/songselect.js @@ -138,13 +138,9 @@ class SongSelect{ var showCustom = false if(gameConfig.google_credentials.gdrive_enabled){ - if(!(/iPhone|iPad/.test(navigator.userAgent))){ - showCustom = true - } - }else{ - if("webkitdirectory" in HTMLInputElement.prototype && !(/Android|iPhone|iPad/.test(navigator.userAgent))){ - showCustom = true - } + showCustom = true + }else if("webkitdirectory" in HTMLInputElement.prototype && !(/Android|iPhone|iPad/.test(navigator.userAgent))){ + showCustom = true } if(showCustom){ this.songs.push({ diff --git a/public/src/js/soundbuffer.js b/public/src/js/soundbuffer.js index 4a37e86..b4d2e07 100644 --- a/public/src/js/soundbuffer.js +++ b/public/src/js/soundbuffer.js @@ -2,13 +2,16 @@ constructor(){ var AudioContext = window.AudioContext || window.webkitAudioContext this.context = new AudioContext() + this.audioDecoder = this.context.decodeAudioData.bind(this.context) + this.oggDecoder = this.audioDecoder pageEvents.add(window, ["click", "touchend", "keypress"], this.pageClicked.bind(this)) this.gainList = [] } load(file, gain){ + var decoder = file.name.endsWith(".ogg") ? this.oggDecoder : this.audioDecoder return file.arrayBuffer().then(response => { return new Promise((resolve, reject) => { - return this.context.decodeAudioData(response, resolve, reject) + return decoder(response, resolve, reject) }).catch(error => Promise.reject([error, file.url])) }).then(buffer => { return new Sound(gain || {soundBuffer: this}, buffer) @@ -62,6 +65,9 @@ gain.setVolume(gain.defaultVol) } } + fallbackDecoder(buffer, resolve, reject){ + Oggmented().then(oggmented => oggmented.decodeOggData(buffer, resolve, reject), reject) + } } class SoundGain{ constructor(soundBuffer, channel){ diff --git a/templates/admin_song_detail.html b/templates/admin_song_detail.html index 85edf5a..12ef1d7 100644 --- a/templates/admin_song_detail.html +++ b/templates/admin_song_detail.html @@ -78,13 +78,21 @@
-

+

+
+

+ +
+

diff --git a/templates/admin_song_new.html b/templates/admin_song_new.html index 3e7344b..aefacc4 100644 --- a/templates/admin_song_new.html +++ b/templates/admin_song_new.html @@ -74,13 +74,21 @@
-

+

+
+

+ +
+