Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Rivill
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
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
MINT
Rivill
Commits
82a6e3cf
Commit
82a6e3cf
authored
2 years ago
by
Florent Berthaut
Browse files
Options
Downloads
Patches
Plain Diff
Fixed crash when jack is not started
parent
dd21fff1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/audio/AudioManager.cpp
+25
-17
25 additions, 17 deletions
src/audio/AudioManager.cpp
with
25 additions
and
17 deletions
src/audio/AudioManager.cpp
+
25
−
17
View file @
82a6e3cf
...
...
@@ -111,28 +111,36 @@ void AudioManager::init() {
m_rtBufSize
=
1024
;
m_rtAudio
->
openStream
(
param
,
NULL
,
RTAUDIO_FLOAT32
,
data
.
nRate
,
bool
init
=
true
;
try
{
m_rtAudio
->
openStream
(
param
,
NULL
,
RTAUDIO_FLOAT32
,
data
.
nRate
,
&
m_rtBufSize
,
AudioManager
::
rtaudio_callback
,
&
data
,
options
);
AudioManager
::
rtaudio_callback
,
&
data
,
options
);
}
catch
(
const
exception
&
e
)
{
init
=
false
;
}
int
nbBufs
=
5
;
m_bufSize
=
m_rtBufSize
*
nbBufs
;
if
(
init
)
{
int
nbBufs
=
5
;
m_bufSize
=
m_rtBufSize
*
nbBufs
;
data
.
ringBuffer
=
ringbuffer_create
(
m_bufSize
*
3
);
data
.
ringBuffer
=
ringbuffer_create
(
m_bufSize
*
3
);
data
.
nChannel
=
param
->
nChannels
;
data
.
bufSize
=
m_bufSize
;
data
.
buffer
=
new
float
[
m_bufSize
];
data
.
nbBufs
=
nbBufs
;
data
.
bufCounter
=
0
;
memset
(
&
data
.
buffer
[
0
],
0
,
data
.
bufSize
*
sizeof
(
float
));
data
.
nChannel
=
param
->
nChannels
;
data
.
bufSize
=
m_bufSize
;
data
.
buffer
=
new
float
[
m_bufSize
];
data
.
nbBufs
=
nbBufs
;
data
.
bufCounter
=
0
;
memset
(
&
data
.
buffer
[
0
],
0
,
data
.
bufSize
*
sizeof
(
float
));
data
.
mixSize
=
m_rtBufSize
;
data
.
mixBuffer
=
new
float
[
data
.
mixSize
];
memset
(
&
data
.
mixBuffer
[
0
],
0
,
data
.
mixSize
*
sizeof
(
float
));
data
.
mixSize
=
m_rtBufSize
;
data
.
mixBuffer
=
new
float
[
data
.
mixSize
];
memset
(
&
data
.
mixBuffer
[
0
],
0
,
data
.
mixSize
*
sizeof
(
float
));
m_thread
=
new
std
::
thread
(
audioThreadFunction
,
this
);
m_init
=
true
;
m_thread
=
new
std
::
thread
(
audioThreadFunction
,
this
);
m_init
=
true
;
}
}
...
...
@@ -147,9 +155,9 @@ bool AudioManager::changeBuf(float* outputBuf, float maxSinValue) {
}
else
{
//cout<<"AudioManager : Could not write buffer"<<endl;
return
false
;
}
}
return
false
;
}
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