FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
API-Examples/macOS/SimpleFilter/ExtensionAudioFilter.cpp at main · jinweizhao/API-Examples · GitHub
jinweizhao
/
API-Examples
Public
forked from
AgoraIO/API-Examples
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
API-Examples
/
macOS
/
SimpleFilter
/
ExtensionAudioFilter.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (28 loc) · 1.14 KB
Breadcrumbs
API-Examples
/
macOS
/
SimpleFilter
/
ExtensionAudioFilter.cpp
Copy path
File metadata and controls
35 lines (28 loc) · 1.14 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
//
Created by 张涛 on 2020/4/26.
//
#
include
"
ExtensionAudioFilter.hpp
"
#
include
<
sstream
>
namespace
agora
{
namespace
extension
{
ExtensionAudioFilter::ExtensionAudioFilter
(
const
char
* name, agora_refptr<AdjustVolumeAudioProcessor> audioProcessor) {
filterName_ = name;
audioProcessor_ = audioProcessor;
}
ExtensionAudioFilter::~ExtensionAudioFilter
() {
}
bool
ExtensionAudioFilter::adaptAudioFrame
(
const
media::base::AudioPcmFrame& inAudioPcmFrame,
media::base::AudioPcmFrame& adaptedPcmFrame) {
return
audioProcessor_->
processFrame
(inAudioPcmFrame, adaptedPcmFrame) ==
0
;
}
int
ExtensionAudioFilter::setProperty
(
const
char
* key,
const
void
* buf,
int
buf_size) {
std::string str_volume =
"
100
"
;
if
(
std::string
(key) ==
"
volume
"
) {
str_volume =
std::string
(
static_cast
<
const
char
*>(buf), buf_size);
}
int
int_volume_ =
atoi
(str_volume.
c_str
());
audioProcessor_->
setVolume
(int_volume_);
return
ERR_OK
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL