Skip to content

Commit

Permalink
Testing for Sound Card's volume control PART-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kumar-laxmi committed Feb 9, 2024
1 parent 7060339 commit 199353c
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 10 deletions.
Binary file modified app/__pycache__/views.cpython-311.pyc
Binary file not shown.
Binary file modified app/sounds.sqlite3
Binary file not shown.
20 changes: 10 additions & 10 deletions app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ def index(request):
start_mitral_thread('normal_heart')
elif 'split_first_heart_sound_mitral_valve' in request.POST:
print('\nSound Played: Split First Heart, Location: Mitral Valve')
start_mitral_thread('split_first_heart_sound')
start_mitral_thread('split_first_heart')
elif 'split_second_heart_sound_mitral_valve' in request.POST:
print('\nSound Played: Split Second Heart, Location: Mitral Valve')
start_mitral_thread('split_second_heart_sound')
start_mitral_thread('split_second_heart')
elif 'third_heart_sound_mitral_valve' in request.POST:
print('\nSound Played: Third Heart (gallop), Location: Mitral Valve')
start_mitral_thread('third_heart_sound_gallop')
Expand Down Expand Up @@ -399,10 +399,10 @@ def index(request):
start_aortic_thread('normal_heart')
elif 'split_first_heart_sound_aortic_valve' in request.POST:
print('\nSound Played: Split First Heart, Location: Aortic Valve')
start_aortic_thread('split_first_heart_sound')
start_aortic_thread('split_first_heart')
elif 'split_second_heart_sound_aortic_valve' in request.POST:
print('\nSound Played: Split Second Heart, Location: Aortic Valve')
start_aortic_thread('split_second_heart_sound')
start_aortic_thread('split_second_heart')
elif 'third_heart_sound_aortic_valve' in request.POST:
print('\nSound Played: Third Heart (gallop), Location: Aortic Valve')
start_aortic_thread('third_heart_sound_gallop')
Expand Down Expand Up @@ -524,10 +524,10 @@ def index(request):
start_pulmonary_thread('normal_heart')
elif 'split_first_heart_sound_pulmonary_valve' in request.POST:
print('\nSound Played: Split First Heart, Location: Pulmonary Valve')
start_pulmonary_thread('split_first_heart_sound')
start_pulmonary_thread('split_first_heart')
elif 'split_second_heart_sound_pulmonary_valve' in request.POST:
print('\nSound Played: Split Second Heart, Location: Pulmonanary Valve')
start_pulmonary_thread('split_second_heart_sound')
start_pulmonary_thread('split_second_heart')
elif 'third_heart_sound_pulmonary_valve' in request.POST:
print('\nSound Played: Third Heart (gallop), Location: Pulmonanary Valve')
start_pulmonary_thread('third_heart_sound_gallop')
Expand Down Expand Up @@ -649,10 +649,10 @@ def index(request):
start_tricuspid_thread('normal_heart')
elif 'split_first_heart_sound_tricuspid_valvee' in request.POST:
print('\nSound Played: Split First Heart, Location: Tricuspid Valve')
start_tricuspid_thread('split_first_heart_sound')
start_tricuspid_thread('split_first_heart')
elif 'split_second_heart_sound_tricuspid_valve' in request.POST:
print('\nSound Played: Split Second Heart, Location: Tricuspid Valve')
start_tricuspid_thread('split_second_heart_sound')
start_tricuspid_thread('split_second_heart')
elif 'third_heart_sound_tricuspid_valve' in request.POST:
print('\nSound Played: Third Heart (gallop), Location: Tricuspid Valve')
start_tricuspid_thread('third_heart_sound_gallop')
Expand Down Expand Up @@ -774,10 +774,10 @@ def index(request):
start_erb_thread('normal_heart')
elif 'split_first_heart_sound_erb_point' in request.POST:
print('\nSound Played: Split First Heart, Location: Erb Valve')
start_erb_thread('split_first_heart_sound')
start_erb_thread('split_first_heart')
elif 'split_second_heart_sound_erb_point' in request.POST:
print('\nSound Played: Split Second Heart, Location: Erb Valve')
start_erb_thread('split_second_heart_sound')
start_erb_thread('split_second_heart')
elif 'third_heart_sound_erb_point' in request.POST:
print('\nSound Played: Third Heart (gallop), Location: Erb Valve')
start_erb_thread('third_heart_sound_gallop')
Expand Down
127 changes: 127 additions & 0 deletions db_test.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import sqlite3\n",
"import numpy as np\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"try:\n",
" con = sqlite3.connect(\"/home/pi/Downloads/Auscultation-Simulator-Application/app/sounds.sqlite3\", check_same_thread=False)\n",
"except:\n",
" con = sqlite3.connect(\"/Users/kumarlaxmikant/Desktop/Visual_Studio/Auscultation-Simulator-Application/app/sounds.sqlite3\", check_same_thread=False)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"cur = con.cursor()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(0,\n",
" 'pulmonary_hypertension',\n",
" 'T',\n",
" 'app/static/audio/heart/pulmonary_hypertension/T/combined_audio.wav')"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"temp = cur.execute(\"SELECT * FROM app_heartaudio\")\n",
"temp.fetchone()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<sqlite3.Cursor at 0x11b00bb40>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cur.execute(\"UPDATE app_heartaudio SET sound_name='split_first_heart' WHERE sound_name='split_first_heart_sound'\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"con.commit()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"cur.execute(\"UPDATE app_heartaudio SET sound_name='split_second_heart' WHERE sound_name='split_second_heart_sound'\")\n",
"con.commit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "virtualenv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Empty file removed temp1.html
Empty file.

0 comments on commit 199353c

Please sign in to comment.