buletomato25 commited on
Commit
0866ea5
·
1 Parent(s): ac884fd
__pycache__/analyze.cpython-310.pyc CHANGED
Binary files a/__pycache__/analyze.cpython-310.pyc and b/__pycache__/analyze.cpython-310.pyc differ
 
__pycache__/process.cpython-310.pyc CHANGED
Binary files a/__pycache__/process.cpython-310.pyc and b/__pycache__/process.cpython-310.pyc differ
 
__pycache__/transcription.cpython-310.pyc CHANGED
Binary files a/__pycache__/transcription.cpython-310.pyc and b/__pycache__/transcription.cpython-310.pyc differ
 
app.py CHANGED
@@ -56,6 +56,20 @@ def reset_html():
56
  #メンバー削除
57
  @app.route('/reset_member', methods=['GET', 'POST'])
58
  def reset_member():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  users.clear()
60
  return render_template('index.html', users = users)
61
 
 
56
  #メンバー削除
57
  @app.route('/reset_member', methods=['GET', 'POST'])
58
  def reset_member():
59
+ global users # ←これを追加!
60
+ #data = request.get_json()
61
+ #name = data['name'] # 名前を取得
62
+ base_audio_dir = "/tmp/data/base_audio"
63
+ for name in users:
64
+ file_path = os.path.join(base_audio_dir, f"{name}.wav")
65
+ if os.path.exists(file_path):
66
+ try:
67
+ os.remove(file_path)
68
+ print(f"{file_path} を削除しました。")
69
+ except Exception as e:
70
+ print(f"削除中にエラーが発生しました: {e}")
71
+ else:
72
+ print(f"ファイルが存在しません: {file_path}")
73
  users.clear()
74
  return render_template('index.html', users = users)
75
 
static/reset.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // サーバーからメンバー情報を取得してチャートを更新する関数
2
+ async function updateChartFrom() {
3
+ try {
4
+ const response = await fetch("/confirm");
5
+ if (!response.ok) {
6
+ throw new Error(`HTTP error! status: ${response.status}`);
7
+ }
8
+ const data = await response.json();
9
+ if (!data || !data.members || !Array.isArray(data.members)) {
10
+ console.error("Invalid member data received:", data);
11
+ members = ["member1"];
12
+ return;
13
+ }
14
+ members = data.members;
15
+ } catch (error) {}
16
+ }
17
+
18
+ function showRecorder() {
19
+ window.location.href = "/index";
20
+ }
21
+ function showReset() {
22
+ window.location.href = "/reset_member";
23
+ }
templates/reset.html CHANGED
@@ -37,5 +37,7 @@
37
  window.location.href = "/reset_member";
38
  }
39
  </script>
 
 
40
  </body>
41
  </html>
 
37
  window.location.href = "/reset_member";
38
  }
39
  </script>
40
+ <!--<script src="{{ url_for('static', filename='reset.js') }}"></script>
41
+ -->
42
  </body>
43
  </html>