File size: 3,859 Bytes
a060517
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sentiment Analysis</title>
    <style>

        body {

            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

            background-color: #f4f4f4;

            color: #333;

            text-align: center;

            margin: 50px;

        }



        h1 {

            color: #008080;

            margin-bottom: 20px;

        }



        h2 {

            color: #008080;

            margin-bottom: 10px;

        }



        .input-container {

            background-color: #fff;

            padding: 20px;

            border-radius: 10px;

            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

            display: inline-block;

            max-width: 400px;

            margin: 0 auto;

            margin-bottom: 20px;

        }



        label {

            font-weight: bold;

            margin-top: 10px;

            display: block;

            color: #333;

        }



        input, select, button {

            width: 100%;

            padding: 10px;

            margin-top: 5px;

            margin-bottom: 10px;

            box-sizing: border-box;

            border: 1px solid #ccc;

            border-radius: 5px;

        }



        button {

            background-color: #008080;

            color: #fff;

            cursor: pointer;

        }



        button:disabled {

            opacity: 0.5;

            cursor: not-allowed;

        }



        #downloadLink {

            display: block;

            margin-top: 10px;

            color: #008080;

            text-decoration: none;

        }



        #downloadLink:hover {

            text-decoration: underline;

        }



        #result {

            font-weight: bold;

            margin-top: 20px;

            padding: 15px;

            border-radius: 10px;

            background-color: #008080;

            color: #fff;

        }

    </style>
</head>
<body>
    <h1>Sentiment Analysis</h1>

    <!-- Text Input Container -->
    <div class="input-container" id="text_input_container">
        <h2>Text Input</h2>
        <form action="/analyze_input1" method="post">
            <label for="input_text">Enter text:</label>
            <input type="text" name="input_text" id="input_text" placeholder="Enter text" required>
            <button type="submit">Analyze Text</button>
        </form>
    </div>

    <!-- Audio Input Container -->
    <div class="input-container" id="audio_input_container">
        <h2>Audio Input</h2>
        <form action="/analyze_input2" method="post" enctype="multipart/form-data">
            <label for="audio_file">Upload audio file:</label>
            <input type="file" name="audio_file" accept="audio/*" id="audio_file">
            <button type="submit">Analyze Audio</button>
        </form>
    </div>

   <!-- Recording Controls Container -->
<div class="input-container" id="recording_controls_container">
    <h2>Live Audio Recording</h2>
    <form id="startForm" action="/start" onsubmit="startRecording()">
        <button type="submit" id="startRecord">Start Recording</button>
    </form>
    <form id="stopForm" action="/stop" onsubmit="stopRecording()">
        <button type="submit" id="stopRecord">Stop Recording</button>
    </form>
    <form action="/analyse_live">
        <button type="submit">Analyse</button>
    </form>
</div>

    <div id="result"></div>


    <script>

    function startRecording() {

        alert("Please Start Talking. Our System is Recording.");

    }



    function stopRecording() {

        alert("We have Stopped and saved your recording in the 'uploads' folder.");

    }

</script>

</body>
</html>