Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Digital Signal Processing Engine Library
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
DSPE
Digital Signal Processing Engine Library
Commits
5a99ea86
Commit
5a99ea86
authored
3 years ago
by
Damian Karaś
Browse files
Options
Downloads
Patches
Plain Diff
ALSA_support: moved InSampleType choice to open_alsa_device
Signed-off-by:
Damian Karaś
<
s176030@student.pg.edu.pl
>
parent
37ac0ce8
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cpp/ALSA_support.cpp
+31
-14
31 additions, 14 deletions
src/cpp/ALSA_support.cpp
with
31 additions
and
14 deletions
src/cpp/ALSA_support.cpp
+
31
−
14
View file @
5a99ea86
...
...
@@ -499,6 +499,37 @@ int DSP::ALSA_object_t::open_alsa_device(snd_pcm_stream_t stream_type)
return
-
6
;
break
;
}
switch
(
no_of_bytes_in_channel
)
{
case
1
:
InSampleTypeALSA
=
DSP
::
e
::
SampleType
::
ST_uchar
;
break
;
case
2
:
InSampleTypeALSA
=
DSP
::
e
::
SampleType
::
ST_short
;
break
;
case
3
:
InSampleTypeALSA
=
DSP
::
e
::
SampleType
::
ST_int
;
break
;
case
4
:
if
(
IsHigherQualityMode
)
InSampleTypeALSA
=
DSP
::
e
::
SampleType
::
ST_int
;
else
InSampleTypeALSA
=
DSP
::
e
::
SampleType
::
ST_float
;
break
;
case
8
:
InSampleTypeALSA
=
DSP
::
e
::
SampleType
::
ST_double
;
break
;
default:
DSP
::
log
<<
"Unsupported no of bytes in channel"
<<
endl
;
return
-
9
;
break
;
}
}
if
(
non_blocking_mode
==
false
)
...
...
@@ -677,20 +708,6 @@ long DSP::ALSA_object_t::open_PCM_device_4_input(const int &no_of_channels, int
sampling_rate_alsa
=
(
unsigned
int
)
sampling_rate
;
audio_inbuffer_size_in_frames
=
(
snd_pcm_uframes_t
)
audio_inbuffer_size
;
switch
(
no_of_bytes_in_channel
)
{
case
1
:
InSampleTypeALSA
=
DSP
::
e
::
SampleType
::
ST_uchar
;
break
;
case
2
:
InSampleTypeALSA
=
DSP
::
e
::
SampleType
::
ST_short
;
break
;
default:
InSampleTypeALSA
=
DSP
::
e
::
SampleType
::
ST_short
;
no_of_bytes_in_channel
=
2
;
break
;
}
rc
=
open_alsa_device
(
SND_PCM_STREAM_CAPTURE
);
if
(
rc
>
0
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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