Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
0467fbb7
Commit
0467fbb7
authored
Feb 13, 2008
by
Guillaume Carmel-Archambault
Browse files
Temporary back to sflphonedrc device selection
parent
e8ea6e6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/audio/audiolayer.cpp
View file @
0467fbb7
...
@@ -115,13 +115,15 @@ AudioLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize
...
@@ -115,13 +115,15 @@ AudioLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize
{
{
closeStream
();
closeStream
();
_indexIn
=
indexIn
;
_indexOut
=
indexOut
;
_sampleRate
=
sampleRate
;
_sampleRate
=
sampleRate
;
_frameSize
=
frameSize
;
_frameSize
=
frameSize
;
int
portaudioFramePerBuffer
=
FRAME_PER_BUFFER
;
//=FRAME_PER_BUFFER; //= paFramesPerBufferUnspecified;
int
portaudioFramePerBuffer
=
FRAME_PER_BUFFER
;
//=FRAME_PER_BUFFER; //= paFramesPerBufferUnspecified;
//int portaudioFramePerBuffer = (int) (8000 * frameSize / 1000); //= paFramesPerBufferUnspecified;
//int portaudioFramePerBuffer = (int) (8000 * frameSize / 1000); //= paFramesPerBufferUnspecified;
// Select default audio API
// Select default audio API
selectPreferedApi
(
paALSA
,
indexIn
,
indexOut
);
//
selectPreferedApi(paALSA,
_
indexIn,
_
indexOut);
int
nbDevice
=
getDeviceCount
();
int
nbDevice
=
getDeviceCount
();
_debug
(
"Nb of audio devices: %i
\n
"
,
nbDevice
);
_debug
(
"Nb of audio devices: %i
\n
"
,
nbDevice
);
...
@@ -129,17 +131,7 @@ AudioLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize
...
@@ -129,17 +131,7 @@ AudioLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize
_debug
(
"Portaudio detect no sound card."
);
_debug
(
"Portaudio detect no sound card."
);
return
;
return
;
}
else
{
}
else
{
// not good,
_debug
(
" Setting audiolayer: device in=%2d, out=%2d
\n
"
,
_indexIn
,
_indexOut
);
// if (indexIn >= nbDevice) {
// _debug(" Portaudio auto-select device #0 for input because device #%02d is not found\n", indexIn);
// indexIn = 0;
// }
// if (indexOut >= nbDevice) {
// _debug(" Portaudio auto-select device #0 for output because device #%02d is not found\n", indexOut);
// indexOut = 0;
// }
_debug
(
" Setting audiolayer: device in=%2d, out=%2d
\n
"
,
indexIn
,
indexOut
);
_debug
(
" : nb channel in=%2d, out=%2d
\n
"
,
_inChannel
,
_outChannel
);
_debug
(
" : nb channel in=%2d, out=%2d
\n
"
,
_inChannel
,
_outChannel
);
_debug
(
" : sample rate=%5d, format=%s
\n
"
,
_sampleRate
,
SFLPortaudioFormatString
);
_debug
(
" : sample rate=%5d, format=%s
\n
"
,
_sampleRate
,
SFLPortaudioFormatString
);
_debug
(
" : frame per buffer=%d
\n
"
,
portaudioFramePerBuffer
);
_debug
(
" : frame per buffer=%d
\n
"
,
portaudioFramePerBuffer
);
...
@@ -148,15 +140,15 @@ AudioLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize
...
@@ -148,15 +140,15 @@ AudioLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize
try
{
try
{
// Set up the parameters required to open a (Callback)Stream:
// Set up the parameters required to open a (Callback)Stream:
portaudio
::
DirectionSpecificStreamParameters
portaudio
::
DirectionSpecificStreamParameters
inParams
(
portaudio
::
System
::
instance
().
deviceByIndex
(
indexIn
),
inParams
(
portaudio
::
System
::
instance
().
deviceByIndex
(
_
indexIn
),
_inChannel
,
SFLPortaudioFormat
,
true
,
_inChannel
,
SFLPortaudioFormat
,
true
,
portaudio
::
System
::
instance
().
deviceByIndex
(
indexIn
).
defaultLowInputLatency
(),
portaudio
::
System
::
instance
().
deviceByIndex
(
_
indexIn
).
defaultLowInputLatency
(),
NULL
);
NULL
);
portaudio
::
DirectionSpecificStreamParameters
outParams
(
portaudio
::
DirectionSpecificStreamParameters
outParams
(
portaudio
::
System
::
instance
().
deviceByIndex
(
indexOut
),
portaudio
::
System
::
instance
().
deviceByIndex
(
_
indexOut
),
_outChannel
,
SFLPortaudioFormat
,
true
,
_outChannel
,
SFLPortaudioFormat
,
true
,
portaudio
::
System
::
instance
().
deviceByIndex
(
indexOut
).
defaultLowOutputLatency
(),
portaudio
::
System
::
instance
().
deviceByIndex
(
_
indexOut
).
defaultLowOutputLatency
(),
NULL
);
NULL
);
// like audacity
// like audacity
...
...
src/audio/audiolayer.h
View file @
0467fbb7
...
@@ -116,6 +116,12 @@ class AudioLayer {
...
@@ -116,6 +116,12 @@ class AudioLayer {
portaudio
::
MemFunCallbackStream
<
AudioLayer
>
*
_stream
;
portaudio
::
MemFunCallbackStream
<
AudioLayer
>
*
_stream
;
/**
* Portaudio indexes of audio devices on which stream has been opened
*/
int
_indexIn
;
int
_indexOut
;
/**
/**
* Sample Rate SFLphone should send sound data to the sound card
* Sample Rate SFLphone should send sound data to the sound card
* The value can be set in the user config file- now: 44100HZ
* The value can be set in the user config file- now: 44100HZ
...
...
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