Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
savoirfairelinux
jami-daemon
Commits
a32f9e98
Commit
a32f9e98
authored
15 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
git+ssh://repos-sflphone-git@git.sflphone.org/~/sflphone
parents
02c93610
3ef3ad62
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-common/src/iax/iaxvoiplink.cpp
+3
-5
3 additions, 5 deletions
sflphone-common/src/iax/iaxvoiplink.cpp
with
3 additions
and
5 deletions
sflphone-common/src/iax/iaxvoiplink.cpp
+
3
−
5
View file @
a32f9e98
...
@@ -326,7 +326,7 @@ IAXVoIPLink::sendAudioFromMic (void)
...
@@ -326,7 +326,7 @@ IAXVoIPLink::sendAudioFromMic (void)
// we have to get 20ms of data from the mic *20/1000 = /50
// we have to get 20ms of data from the mic *20/1000 = /50
// rate/50 shall be lower than IAX__20S_48KHZ_MAX
// rate/50 shall be lower than IAX__20S_48KHZ_MAX
maxBytesToGet
=
audiolayer
->
get
SampleRate
()
*
audiolayer
->
getFrameSize
()
/
1000
*
sizeof
(
SFLDataFormat
);
maxBytesToGet
=
_mainBuffer
SampleRate
*
audiolayer
->
getFrameSize
()
/
1000
*
sizeof
(
SFLDataFormat
);
// available bytes inside ringbuffer
// available bytes inside ringbuffer
availBytesFromMic
=
audiolayer
->
getMainBuffer
()
->
availForGet
(
currentCall
->
getCallId
());
availBytesFromMic
=
audiolayer
->
getMainBuffer
()
->
availForGet
(
currentCall
->
getCallId
());
...
@@ -339,18 +339,14 @@ IAXVoIPLink::sendAudioFromMic (void)
...
@@ -339,18 +339,14 @@ IAXVoIPLink::sendAudioFromMic (void)
// take the lowest
// take the lowest
bytesAvail
=
(
availBytesFromMic
<
maxBytesToGet
)
?
availBytesFromMic
:
maxBytesToGet
;
bytesAvail
=
(
availBytesFromMic
<
maxBytesToGet
)
?
availBytesFromMic
:
maxBytesToGet
;
//_debug("available = %d, maxBytesToGet = %d\n", availBytesFromMic, maxBytesToGet);
// Get bytes from micRingBuffer to data_from_mic
// Get bytes from micRingBuffer to data_from_mic
nbSample_
=
audiolayer
->
getMainBuffer
()
->
getData
(
micData
,
bytesAvail
,
100
,
currentCall
->
getCallId
())
/
sizeof
(
SFLDataFormat
);
nbSample_
=
audiolayer
->
getMainBuffer
()
->
getData
(
micData
,
bytesAvail
,
100
,
currentCall
->
getCallId
())
/
sizeof
(
SFLDataFormat
);
// Store the number of samples for recording
// Store the number of samples for recording
nbSampleForRec_
=
nbSample_
;
nbSampleForRec_
=
nbSample_
;
// _debug("IAXVoIPLink::sendAudioFromMic : %i \n",nbSampleForRec_);
if
(
ac
->
getClockRate
()
&&
(
ac
->
getClockRate
()
!=
_mainBufferSampleRate
))
{
if
(
ac
->
getClockRate
()
&&
(
ac
->
getClockRate
()
!=
_mainBufferSampleRate
))
{
...
@@ -359,10 +355,12 @@ IAXVoIPLink::sendAudioFromMic (void)
...
@@ -359,10 +355,12 @@ IAXVoIPLink::sendAudioFromMic (void)
// for the mono: range = 0 to IAX_FRAME2SEND * sizeof(int16)
// for the mono: range = 0 to IAX_FRAME2SEND * sizeof(int16)
compSize
=
ac
->
codecEncode
(
micDataEncoded
,
micDataConverted
,
nbSample_
*
sizeof
(
int16
));
compSize
=
ac
->
codecEncode
(
micDataEncoded
,
micDataConverted
,
nbSample_
*
sizeof
(
int16
));
}
else
{
}
else
{
// for the mono: range = 0 to IAX_FRAME2SEND * sizeof(int16)
// for the mono: range = 0 to IAX_FRAME2SEND * sizeof(int16)
compSize
=
ac
->
codecEncode
(
micDataEncoded
,
micData
,
nbSample_
*
sizeof
(
int16
));
compSize
=
ac
->
codecEncode
(
micDataEncoded
,
micData
,
nbSample_
*
sizeof
(
int16
));
}
}
// Send it out!
// Send it out!
...
...
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