Skip to content
Snippets Groups Projects
Commit dbca7cd3 authored by Tommi Penttinen's avatar Tommi Penttinen
Browse files

Add audio

parent 8ad4a14f
No related branches found
No related tags found
No related merge requests found
Pipeline #41897 passed
File added
File added
File added
File added
File added
File added
......@@ -40,12 +40,19 @@
VEHICLE_TRUCK = 2;
VEHICLE_BUS = 3;
AUDIO = {};
// Wav files are also available.
AUDIO[VEHICLE_CAR] = 'audio/car_marimba.mp3';
AUDIO[VEHICLE_TRUCK] = 'audio/truck_glockenspiel.mp3';
AUDIO[VEHICLE_BUS] = 'audio/bus_mallets.mp3';
SEP = ',';
SERVER = 'wss://smarter-data.tt.utu.fi/ws/';
// SERVER = 'ws://localhost:8080/'
function send_data(ws, direction, vehicle_class) {
ws.send(TMS_NUMBER + SEP + direction + SEP + vehicle_class + SEP + new Date().getTime());
new Audio(AUDIO[vehicle_class]).play();
}
</script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment