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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
3baa0f47
Commit
3baa0f47
authored
May 30, 2012
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #11828: audiofile: fix broken build
parent
6f135ee2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
daemon/src/audio/sound/audiofile.cpp
+6
-7
6 additions, 7 deletions
daemon/src/audio/sound/audiofile.cpp
with
6 additions
and
7 deletions
daemon/src/audio/sound/audiofile.cpp
+
6
−
7
View file @
3baa0f47
...
@@ -109,7 +109,7 @@ RawFile::RawFile(const std::string& name, sfl::AudioCodec *codec, unsigned int s
...
@@ -109,7 +109,7 @@ RawFile::RawFile(const std::string& name, sfl::AudioCodec *codec, unsigned int s
}
}
WaveFile
::
WaveFile
(
const
std
::
string
&
fileName
,
int
sampleRate
)
:
AudioFile
(
fileName
,
sampleRate
)
WaveFile
::
WaveFile
(
const
std
::
string
&
fileName
,
unsigned
int
sampleRate
)
:
AudioFile
(
fileName
,
sampleRate
)
{
{
const
std
::
fstream
fs
(
fileName
.
c_str
(),
std
::
ios_base
::
in
);
const
std
::
fstream
fs
(
fileName
.
c_str
(),
std
::
ios_base
::
in
);
...
@@ -174,7 +174,8 @@ WaveFile::WaveFile(const std::string &fileName, int sampleRate) : AudioFile(file
...
@@ -174,7 +174,8 @@ WaveFile::WaveFile(const std::string &fileName, int sampleRate) : AudioFile(file
fileStream
.
read
(
data
,
sizeof
data
/
sizeof
*
data
);
fileStream
.
read
(
data
,
sizeof
data
/
sizeof
*
data
);
// Samplerate converter initialized with 88200 sample long
// Samplerate converter initialized with 88200 sample long
SamplerateConverter
converter
(
std
::
max
(
fileRate
,
newRate
));
const
int
rate
=
static_cast
<
SINT32
>
(
sampleRate_
);
SamplerateConverter
converter
(
std
::
max
(
fileRate
,
rate
));
// Get length of data from the header.
// Get length of data from the header.
SINT32
bytes
;
SINT32
bytes
;
...
@@ -200,15 +201,13 @@ WaveFile::WaveFile(const std::string &fileName, int sampleRate) : AudioFile(file
...
@@ -200,15 +201,13 @@ WaveFile::WaveFile(const std::string &fileName, int sampleRate) : AudioFile(file
nbSamples
*=
0.5
;
nbSamples
*=
0.5
;
}
}
if
(
fileRate
!=
newR
ate
)
{
if
(
fileRate
!=
r
ate
)
{
const
float
ratio
=
new
Rate
/
(
float
)
fileRate
;
const
float
ratio
=
sample
Rate
_
/
(
float
)
fileRate
;
const
int
outSamples
=
ceil
(
nbSamples
*
ratio
);
const
int
outSamples
=
ceil
(
nbSamples
*
ratio
);
size_
=
outSamples
;
size_
=
outSamples
;
buffer_
=
new
SFLDataFormat
[
size_
];
buffer_
=
new
SFLDataFormat
[
size_
];
converter
.
resample
(
tempBuffer
,
buffer_
,
size_
,
fileRate
,
new
Rate
,
nbSamples
);
converter
.
resample
(
tempBuffer
,
buffer_
,
size_
,
fileRate
,
sample
Rate
_
,
nbSamples
);
delete
[]
tempBuffer
;
delete
[]
tempBuffer
;
}
else
}
else
buffer_
=
tempBuffer
;
buffer_
=
tempBuffer
;
sampleRate_
=
newRate
;
}
}
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
sign in
to comment