Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
22_23-J 18
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23-J 18
22_23-J 18
Commits
7c11f7cb
Commit
7c11f7cb
authored
Apr 20, 2023
by
salukadev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show debug msg for audio
parent
95c5b194
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
247 additions
and
960 deletions
+247
-960
App/Frontend/package-lock.json
App/Frontend/package-lock.json
+16
-0
App/Frontend/package.json
App/Frontend/package.json
+2
-0
App/Frontend/screens/SpeechTherapyScreen.js
App/Frontend/screens/SpeechTherapyScreen.js
+27
-3
App/Frontend/yarn.lock
App/Frontend/yarn.lock
+202
-957
No files found.
App/Frontend/package-lock.json
View file @
7c11f7cb
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
"react-native-screens": "~3.20.0",
"react-native-screens": "~3.20.0",
"react-native-svg": "13.4.0",
"react-native-svg": "13.4.0",
"react-native-swiper": "^1.6.0",
"react-native-swiper": "^1.6.0",
"react-native-toast-message": "^2.1.6",
"react-navigation": "^4.4.4",
"react-navigation": "^4.4.4",
"react-navigation-stack": "^2.10.4"
"react-navigation-stack": "^2.10.4"
},
},
...
@@ -12866,6 +12867,15 @@
...
@@ -12866,6 +12867,15 @@
"prop-types": "^15.5.10"
"prop-types": "^15.5.10"
}
}
},
},
"node_modules/react-native-toast-message": {
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/react-native-toast-message/-/react-native-toast-message-2.1.6.tgz",
"integrity": "sha512-VctXuq20vmRa9AE13acaNZhrLcS3FaBS2zEevS3+vhBsnVZYG0FIlWIis9tVnpnNxUb3ART+BWtwQjzSttXTng==",
"peerDependencies": {
"react": "*",
"react-native": "*"
}
},
"node_modules/react-native-windows": {
"node_modules/react-native-windows": {
"version": "0.71.6",
"version": "0.71.6",
"resolved": "https://registry.npmjs.org/react-native-windows/-/react-native-windows-0.71.6.tgz",
"resolved": "https://registry.npmjs.org/react-native-windows/-/react-native-windows-0.71.6.tgz",
...
@@ -24943,6 +24953,12 @@
...
@@ -24943,6 +24953,12 @@
"prop-types": "^15.5.10"
"prop-types": "^15.5.10"
}
}
},
},
"react-native-toast-message": {
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/react-native-toast-message/-/react-native-toast-message-2.1.6.tgz",
"integrity": "sha512-VctXuq20vmRa9AE13acaNZhrLcS3FaBS2zEevS3+vhBsnVZYG0FIlWIis9tVnpnNxUb3ART+BWtwQjzSttXTng==",
"requires": {}
},
"react-native-windows": {
"react-native-windows": {
"version": "0.71.6",
"version": "0.71.6",
"resolved": "https://registry.npmjs.org/react-native-windows/-/react-native-windows-0.71.6.tgz",
"resolved": "https://registry.npmjs.org/react-native-windows/-/react-native-windows-0.71.6.tgz",
App/Frontend/package.json
View file @
7c11f7cb
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
"axios"
:
"^1.3.6"
,
"axios"
:
"^1.3.6"
,
"expo"
:
"~48.0.9"
,
"expo"
:
"~48.0.9"
,
"expo-av"
:
"~13.2.1"
,
"expo-av"
:
"~13.2.1"
,
"expo-camera"
:
"~13.2.1"
,
"expo-file-system"
:
"~15.2.2"
,
"expo-file-system"
:
"~15.2.2"
,
"expo-screen-orientation"
:
"~5.1.1"
,
"expo-screen-orientation"
:
"~5.1.1"
,
"expo-status-bar"
:
"~1.4.4"
,
"expo-status-bar"
:
"~1.4.4"
,
...
@@ -29,6 +30,7 @@
...
@@ -29,6 +30,7 @@
"react-native-screens"
:
"~3.20.0"
,
"react-native-screens"
:
"~3.20.0"
,
"react-native-svg"
:
"13.4.0"
,
"react-native-svg"
:
"13.4.0"
,
"react-native-swiper"
:
"^1.6.0"
,
"react-native-swiper"
:
"^1.6.0"
,
"react-native-toast-message"
:
"^2.1.6"
,
"react-navigation"
:
"^4.4.4"
,
"react-navigation"
:
"^4.4.4"
,
"react-navigation-stack"
:
"^2.10.4"
"react-navigation-stack"
:
"^2.10.4"
},
},
...
...
App/Frontend/screens/SpeechTherapyScreen.js
View file @
7c11f7cb
...
@@ -12,6 +12,7 @@ import { Audio } from 'expo-av';
...
@@ -12,6 +12,7 @@ import { Audio } from 'expo-av';
import
*
as
ScreenOrientation
from
'
expo-screen-orientation
'
;
import
*
as
ScreenOrientation
from
'
expo-screen-orientation
'
;
import
*
as
FileSystem
from
'
expo-file-system
'
;
import
*
as
FileSystem
from
'
expo-file-system
'
;
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
Toast
from
'
react-native-toast-message
'
;
const
SpeechTherapyScreen
=
({
navigation
})
=>
{
const
SpeechTherapyScreen
=
({
navigation
})
=>
{
...
@@ -25,6 +26,7 @@ const SpeechTherapyScreen = ({ navigation }) => {
...
@@ -25,6 +26,7 @@ const SpeechTherapyScreen = ({ navigation }) => {
const
owlPath
=
'
./assets/ST/owl.png
'
;
const
owlPath
=
'
./assets/ST/owl.png
'
;
const
recordingIconPath
=
'
./assets/ST/recording_icon.png
'
;
const
recordingIconPath
=
'
./assets/ST/recording_icon.png
'
;
const
[
recording
,
setRecording
]
=
useState
(
null
);
const
[
recording
,
setRecording
]
=
useState
(
null
);
const
[
receivedText
,
setReceivedText
]
=
useState
(
''
);
const
startRecording
=
async
()
=>
{
const
startRecording
=
async
()
=>
{
...
@@ -80,13 +82,22 @@ const SpeechTherapyScreen = ({ navigation }) => {
...
@@ -80,13 +82,22 @@ const SpeechTherapyScreen = ({ navigation }) => {
name
:
'
recording.mp3
'
,
// Replace with 'recording.m4a' if using iOS
name
:
'
recording.mp3
'
,
// Replace with 'recording.m4a' if using iOS
});
});
const
response
=
await
axios
.
post
(
'
http://192.168.1
0.243
:5000/api/upload-audio
'
,
formData
,
{
const
response
=
await
axios
.
post
(
'
http://192.168.1
.42
:5000/api/upload-audio
'
,
formData
,
{
headers
:
{
headers
:
{
'
Content-Type
'
:
'
multipart/form-data
'
,
'
Content-Type
'
:
'
multipart/form-data
'
,
},
},
});
});
console
.
log
(
'
Audio sent:
'
,
response
.
data
);
console
.
log
(
'
Audio sent:
'
,
response
.
data
);
//setReceivedText(response.data); // Update the receivedText state
// Show the toast message
Toast
.
show
({
type
:
'
success
'
,
text1
:
response
.
data
,
autoHide
:
true
,
visibilityTime
:
4000
,
});
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'
Error while sending audio:
'
,
error
);
console
.
error
(
'
Error while sending audio:
'
,
error
);
}
}
...
@@ -203,7 +214,7 @@ const SpeechTherapyScreen = ({ navigation }) => {
...
@@ -203,7 +214,7 @@ const SpeechTherapyScreen = ({ navigation }) => {
{
recording
&&
<
Image
source
=
{
require
(
recordingIconPath
)}
style
=
{
styles
.
recordingIcon
}
/>
}
{
recording
&&
<
Image
source
=
{
require
(
recordingIconPath
)}
style
=
{
styles
.
recordingIcon
}
/>
}
<
/View
>
<
/View
>
<
/TouchableWithoutFeedback
>
<
/TouchableWithoutFeedback
>
<
Toast
ref
=
{(
ref
)
=>
Toast
.
setRef
(
ref
)}
/
>
<
/View
>
<
/View
>
);
);
...
@@ -263,7 +274,20 @@ const styles = StyleSheet.create({
...
@@ -263,7 +274,20 @@ const styles = StyleSheet.create({
right
:
22
,
right
:
22
,
width
:
45
,
width
:
45
,
height
:
45
,
height
:
45
,
}
},
rreceivedTextContainer
:
{
position
:
'
absolute
'
,
bottom
:
0
,
paddingHorizontal
:
10
,
paddingVertical
:
5
,
alignItems
:
'
center
'
,
justifyContent
:
'
center
'
,
// backgroundColor: 'rgba(0, 0, 0, 0.6)', // Remove this line
},
receivedText
:
{
fontSize
:
35
,
color
:
'
red
'
,
// Change the text color to white
},
});
});
export
default
SpeechTherapyScreen
;
export
default
SpeechTherapyScreen
;
App/Frontend/yarn.lock
View file @
7c11f7cb
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment