Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HighBlueParsers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Best
HighBlueParsers
Commits
b5dee4eb
Commit
b5dee4eb
authored
5 years ago
by
Jan Schlüter
Browse files
Options
Downloads
Patches
Plain Diff
Exit with an error if no audio data is received for a while
parent
44730161
Branches
Branches containing commit
No related tags found
2 merge requests
!2
HighBlueParser dev branch merged to empty main branch
,
!1
High blue rec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
src/main.cpp
+9
-0
9 additions, 0 deletions
src/main.cpp
with
10 additions
and
1 deletion
CMakeLists.txt
+
1
−
1
View file @
b5dee4eb
...
...
@@ -4,7 +4,7 @@ if(POLICY CMP0063)
endif
()
project
(
jasonrec
)
set
(
JASONREC_VERSION
"1.
2
"
)
set
(
JASONREC_VERSION
"1.
3
"
)
add_definitions
(
-DJASONREC_VERSION=
"
${
JASONREC_VERSION
}
"
)
find_path
(
LIBUSB_INCLUDE_DIR
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
9
−
0
View file @
b5dee4eb
...
...
@@ -56,6 +56,7 @@ int record(size_t channels, size_t rate, std::string &filename, float chunklen,
allow_clean_exit
();
size_t
total_samples_wanted
=
totallen
*
rate
;
size_t
total_samples_read
=
0
;
size_t
failed_attempts
=
0
;
std
::
vector
<
std
::
int16_t
>
samples
;
try
{
recorder
.
start_recording
();
...
...
@@ -74,6 +75,14 @@ int record(size_t channels, size_t rate, std::string &filename, float chunklen,
}
// pass it on to the file writer
filewriter
->
write
(
samples
);
failed_attempts
=
0
;
}
else
{
// if we received no message or no audio data 20x in a row, abort
failed_attempts
+=
1
;
if
(
failed_attempts
>=
20
)
{
throw
std
::
runtime_error
(
"Device does not send audio data."
);
}
}
}
recorder
.
stop_recording
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment