Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
21_22-J 38
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
0
Merge Requests
0
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
21_22-J 38
21_22-J 38
Commits
ef01cf5d
Commit
ef01cf5d
authored
Feb 08, 2022
by
W.D.R.P. Sandeepa
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'it18218640' into 'master'
some changes See merge request
!110
parents
893838c8
9b697124
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
frontend/src/screen/activity/Blue.js
frontend/src/screen/activity/Blue.js
+18
-9
No files found.
frontend/src/screen/activity/Blue.js
View file @
ef01cf5d
...
@@ -44,7 +44,7 @@ export default function Blue(color) {
...
@@ -44,7 +44,7 @@ export default function Blue(color) {
// audioInit
// audioInit
function
audioInit
()
{
function
audioInit
()
{
console
.
log
(
'
audioInit
'
);
//
console.log('audioInit');
const
colorAudio
=
{
const
colorAudio
=
{
sampleRate
:
16000
,
sampleRate
:
16000
,
...
@@ -58,17 +58,17 @@ export default function Blue(color) {
...
@@ -58,17 +58,17 @@ export default function Blue(color) {
// checkPermission
// checkPermission
async
function
checkPermission
()
{
async
function
checkPermission
()
{
console
.
log
(
'
checkPermission
'
);
//
console.log('checkPermission');
const
p
=
await
Permissions
.
check
(
'
microphone
'
);
const
p
=
await
Permissions
.
check
(
'
microphone
'
);
console
.
log
(
p
);
//
console.log(p);
console
.
log
(
'
permission check
'
,
p
);
//
console.log('permission check', p);
if
(
p
===
'
authorized
'
)
{
if
(
p
===
'
authorized
'
)
{
console
.
log
(
'
if
'
);
//
console.log('if');
//audio start
//audio start
audioStart
();
audioStart
();
}
else
{
}
else
{
console
.
log
(
'
else
'
);
//
console.log('else');
return
requestPermission
();
return
requestPermission
();
}
}
...
@@ -77,13 +77,13 @@ export default function Blue(color) {
...
@@ -77,13 +77,13 @@ export default function Blue(color) {
// requestPermission
// requestPermission
async
function
requestPermission
()
{
async
function
requestPermission
()
{
const
p
=
await
Permissions
.
request
(
'
microphone
'
);
const
p
=
await
Permissions
.
request
(
'
microphone
'
);
console
.
log
(
'
permission request
'
,
p
);
//
console.log('permission request', p);
}
}
// audioStart
// audioStart
async
function
audioStart
()
{
async
function
audioStart
()
{
console
.
log
(
'
audioStart
'
);
//
console.log('audioStart');
checkPermission
();
checkPermission
();
AudioRecord
.
start
();
AudioRecord
.
start
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -91,6 +91,15 @@ export default function Blue(color) {
...
@@ -91,6 +91,15 @@ export default function Blue(color) {
},
4000
);
},
4000
);
}
}
// audioStop
async
function
audioStop
()
{
// console.log('audioStop');
let
audioFile
=
await
AudioRecord
.
stop
();
console
.
log
(
'
userFile
'
,
audioFile
);
}
return
(
return
(
<
SafeAreaView
>
<
SafeAreaView
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
...
@@ -116,7 +125,7 @@ export default function Blue(color) {
...
@@ -116,7 +125,7 @@ export default function Blue(color) {
<
/View
>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
row
"
,
marginLeft
:
480
}}
>
<
View
style
=
{{
flexDirection
:
"
row
"
,
marginLeft
:
480
}}
>
<
Button
style
=
{
styles
.
button
}
title
=
"
Recode
"
/>
<
Button
style
=
{
styles
.
button
}
title
=
"
Recode
"
onPress
=
{()
=>
{
audioStart
();
}}
/
>
<
Button
title
=
"
Return
"
color
=
"
#1DCE92
"
/>
<
Button
title
=
"
Return
"
color
=
"
#1DCE92
"
/>
<
Button
title
=
"
Exit
"
color
=
"
#841584
"
/>
<
Button
title
=
"
Exit
"
color
=
"
#841584
"
/>
<
/View
>
<
/View
>
...
...
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