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.min.js b/public/src/js/lib/oggmented.min.js new file mode 100644 index 0000000..a1884db --- /dev/null +++ b/public/src/js/lib/oggmented.min.js @@ -0,0 +1,10 @@ +/** + * [oggmented]{@link https://github.com/jfrancos/oggmented} + * + * @namespace oggmented + * @version 1.0.1 + * @author Justin Francos [jf@justinfrancos.com] + * @copyright Justin Francos 2019-2020 + * @license MIT + */ + !function(A,I){"object"==typeof exports&&"object"==typeof module?module.exports=I():"function"==typeof define&&define.amd?define([],I):"object"==typeof exports?exports.oggmented=I():A.oggmented=I()}(window,(function(){return function(A){var I={};function g(C){if(I[C])return I[C].exports;var Q=I[C]={i:C,l:!1,exports:{}};return A[C].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,C){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:C})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var C=Object.create(null);if(g.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(C,Q,function(I){return A[I]}.bind(null,Q));return C},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="/",g(g.s=6)}([function(A,I){var g;g=function(){return this}();try{g=g||new Function("return this")()}catch(A){"object"==typeof window&&(g=window)}A.exports=g},function(A,I){var g,C,Q=A.exports={};function B(){throw new Error("setTimeout has not been defined")}function E(){throw new Error("clearTimeout has not been defined")}function D(A){if(g===setTimeout)return setTimeout(A,0);if((g===B||!g)&&setTimeout)return g=setTimeout,setTimeout(A,0);try{return g(A,0)}catch(I){try{return g.call(null,A,0)}catch(I){return g.call(this,A,0)}}}!function(){try{g="function"==typeof setTimeout?setTimeout:B}catch(A){g=B}try{C="function"==typeof clearTimeout?clearTimeout:E}catch(A){C=E}}();var w,i=[],o=!1,M=-1;function P(){o&&w&&(o=!1,w.length?i=w.concat(i):M=-1,i.length&&n())}function n(){if(!o){var A=D(P);o=!0;for(var I=i.length;I;){for(w=i,i=[];++M1)for(var g=1;g>0];case"i16":return k[A>>1];case"i32":case"i64":return f[A>>2];case"float":return x[A>>2];case"double":return U[A>>3];default:O("invalid type for getValue: "+I)}return null}n=null,w.quit&&(c=w.quit),w.wasmBinary&&(H=w.wasmBinary),w.noExitRuntime&&(s=w.noExitRuntime),"object"!==("undefined"==typeof WebAssembly?"undefined":E(WebAssembly))&&h("no native wasm support detected");var t,K=new WebAssembly.Table({initial:44,maximum:44,element:"anyfunc"}),y=!1;function R(A,I,g,C){var Q={string:function(A){var I=0;if(null!=A&&0!==A){var g=1+(A.length<<2),C=I=iA(g),Q=J;if(0=E&&(E=65536+((1023&E)<<10)|1023&A.charCodeAt(++B)),127>=E){if(C>=g)break;Q[C++]=E}else{if(2047>=E){if(C+1>=g)break;Q[C++]=192|E>>6}else{if(65535>=E){if(C+2>=g)break;Q[C++]=224|E>>12}else{if(C+3>=g)break;Q[C++]=240|E>>18,Q[C++]=128|E>>12&63}Q[C++]=128|E>>6&63}Q[C++]=128|63&E}}Q[C]=0}}return I},array:function(A){var I=iA(A.length);return G.set(A,I),I}},B=function(A){var I=w["_"+A];return I||O("Assertion failed: Cannot call unknown function "+A+", make sure it is exported"),I}(A),E=[];if(A=0,C)for(var D=0;D=C);)++Q;if(16(B=224==(240&B)?(15&B)<<12|E<<6|D:(7&B)<<18|E<<12|D<<6|63&g[A++])?C+=String.fromCharCode(B):(B-=65536,C+=String.fromCharCode(55296|B>>10,56320|1023&B))}}else C+=String.fromCharCode(B)}A=C}}else A="";else A="boolean"===I?!!A:A;return A}(g=B.apply(null,E)),0!==A&&oA(A),g}var N,G,J,k,f,S,x,U,z="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function q(A){N=A,w.HEAP8=G=new Int8Array(A),w.HEAP16=k=new Int16Array(A),w.HEAP32=f=new Int32Array(A),w.HEAPU8=J=new Uint8Array(A),w.HEAPU16=new Uint16Array(A),w.HEAPU32=S=new Uint32Array(A),w.HEAPF32=x=new Float32Array(A),w.HEAPF64=U=new Float64Array(A)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var T=w.INITIAL_MEMORY||16777216;function r(A){for(;0>4,Q=(15&Q)<<4|B>>2;var D=(3&B)<<6|E;I+=String.fromCharCode(C),64!==B&&(I+=String.fromCharCode(Q)),64!==E&&(I+=String.fromCharCode(D))}while(g=g;g*=2){var C=I*(1+.2/g);C=Math.min(C,A+100663296),0<(C=Math.max(16777216,A,C))%65536&&(C+=65536-C%65536);A:{try{t.grow(Math.min(2147418112,C)-N.byteLength+65535>>16),q(t.buffer);var Q=1;break A}catch(A){}Q=void 0}if(Q)return!0}return!1},c:function(A){!s&&(y=!0,w.onExit)&&w.onExit(A),c(A,new MA(A))},memory:t,table:K},_=function(){function A(A){w.asm=A.exports,p--,w.monitorRunDependencies&&w.monitorRunDependencies(p),0==p&&(null!==u&&(clearInterval(u),u=null),V&&(A=V,V=null,A()))}function I(I){A(I.instance)}function g(A){return(H||"function"!=typeof fetch?new Promise((function(A){A(b())})):fetch(X,{credentials:"same-origin"}).then((function(A){if(!A.ok)throw"failed to load wasm binary file at '"+X+"'";return A.arrayBuffer()})).catch((function(){return b()}))).then((function(A){return WebAssembly.instantiate(A,C)})).then(A,(function(A){h("failed to asynchronously prepare wasm: "+A),O(A)}))}var C={a:v};if(p++,w.monitorRunDependencies&&w.monitorRunDependencies(p),w.instantiateWasm)try{return w.instantiateWasm(C,A)}catch(A){return h("Module.instantiateWasm callback failed with error: "+A),!1}return function(){if(H||"function"!=typeof WebAssembly.instantiateStreaming||m(X)||"function"!=typeof fetch)return g(I);fetch(X,{credentials:"same-origin"}).then((function(A){return WebAssembly.instantiateStreaming(A,C).then(I,(function(A){h("wasm streaming compile failed: "+A),h("falling back to ArrayBuffer instantiation"),g(I)}))}))}(),{}}();w.asm=_;var $=w.___wasm_call_ctors=function(){return($=w.___wasm_call_ctors=w.asm.d).apply(null,arguments)};w._open_buffer=function(){return(w._open_buffer=w.asm.e).apply(null,arguments)};var AA=w._close_buffer=function(){return(AA=w._close_buffer=w.asm.f).apply(null,arguments)},IA=w._get_length=function(){return(IA=w._get_length=w.asm.g).apply(null,arguments)},gA=w._get_channels=function(){return(gA=w._get_channels=w.asm.h).apply(null,arguments)},CA=w._get_rate=function(){return(CA=w._get_rate=w.asm.i).apply(null,arguments)};w._get_time=function(){return(w._get_time=w.asm.j).apply(null,arguments)},w._get_streams=function(){return(w._get_streams=w.asm.k).apply(null,arguments)};var QA,BA=w._read_float=function(){return(BA=w._read_float=w.asm.l).apply(null,arguments)},EA=w._free=function(){return(EA=w._free=w.asm.m).apply(null,arguments)},DA=w._malloc=function(){return(DA=w._malloc=w.asm.n).apply(null,arguments)},wA=w.stackSave=function(){return(wA=w.stackSave=w.asm.o).apply(null,arguments)},iA=w.stackAlloc=function(){return(iA=w.stackAlloc=w.asm.p).apply(null,arguments)},oA=w.stackRestore=function(){return(oA=w.stackRestore=w.asm.q).apply(null,arguments)};function MA(A){this.name="ExitStatus",this.message="Program terminated with exit("+A+")",this.status=A}function PA(){function A(){if(!QA&&(QA=!0,w.calledRun=!0,!y)){if(r(Y),r(L),w.onRuntimeInitialized&&w.onRuntimeInitialized(),w.postRun)for("function"==typeof w.postRun&&(w.postRun=[w.postRun]);w.postRun.length;){var A=w.postRun.shift();d.unshift(A)}r(d)}}if(!(0=0&&(A._idleTimeoutId=setTimeout((function(){A._onTimeout&&A._onTimeout()}),I))},g(4),I.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==A&&A.setImmediate||this&&this.setImmediate,I.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==A&&A.clearImmediate||this&&this.clearImmediate}).call(this,g(0))},function(A,I,g){(function(A,I){!function(A,g){"use strict";if(!A.setImmediate){var C,Q,B,E,D,w=1,i={},o=!1,M=A.document,P=Object.getPrototypeOf&&Object.getPrototypeOf(A);P=P&&P.setTimeout?P:A,"[object process]"==={}.toString.call(A.process)?C=function(A){I.nextTick((function(){c(A)}))}:!function(){if(A.postMessage&&!A.importScripts){var I=!0,g=A.onmessage;return A.onmessage=function(){I=!1},A.postMessage("","*"),A.onmessage=g,I}}()?A.MessageChannel?((B=new MessageChannel).port1.onmessage=function(A){c(A.data)},C=function(A){B.port2.postMessage(A)}):M&&"onreadystatechange"in M.createElement("script")?(Q=M.documentElement,C=function(A){var I=M.createElement("script");I.onreadystatechange=function(){c(A),I.onreadystatechange=null,Q.removeChild(I),I=null},Q.appendChild(I)}):C=function(A){setTimeout(c,0,A)}:(E="setImmediate$"+Math.random()+"$",D=function(I){I.source===A&&"string"==typeof I.data&&0===I.data.indexOf(E)&&c(+I.data.slice(E.length))},A.addEventListener?A.addEventListener("message",D,!1):A.attachEvent("onmessage",D),C=function(I){A.postMessage(E+I,"*")}),P.setImmediate=function(A){"function"!=typeof A&&(A=new Function(""+A));for(var I=new Array(arguments.length-1),g=0;g { 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,10 @@ class Loader{ this.addPromise(Promise.all(categoryPromises)) snd.buffer = new SoundBuffer() + if(!oggSupport){ + var oggmentedCtx = new oggmented.default() + snd.buffer.oggDecoder = oggmentedCtx.decodeAudioData.bind(oggmentedCtx) + } snd.musicGain = snd.buffer.createGain() snd.sfxGain = snd.buffer.createGain() snd.previewGain = snd.buffer.createGain() 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..f4c13e2 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) 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 @@
-

+

+
+

+ +
+