Skip to content
Snippets Groups Projects
Commit 878d392f authored by Aline Gondim Santos's avatar Aline Gondim Santos Committed by Adrien Béraud
Browse files

audiofilter: get fmt name from ffmpeg

Change-Id: I6b618bd841b622add69f50846b7c25923b941086
parent a3a9306c
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10) ...@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
# set the project name # set the project name
set (ProjectName AudioFilter) set (ProjectName AudioFilter)
set (Version 1.0.1) set (Version 1.0.2)
project(${ProjectName} VERSION ${Version}) project(${ProjectName} VERSION ${Version})
......
...@@ -63,26 +63,13 @@ FilterAudioSubscriber::setFilterDescription(const int pSampleRate, const int pSa ...@@ -63,26 +63,13 @@ FilterAudioSubscriber::setFilterDescription(const int pSampleRate, const int pSa
{ {
int rSamples = 1024; // due to afir internal fifo int rSamples = 1024; // due to afir internal fifo
int midSampleRate = pSampleRate * rSamples / pSamples; int midSampleRate = pSampleRate * rSamples / pSamples;
std::string outFormat {"s16"}; std::string outFormat = av_get_sample_fmt_name((AVSampleFormat)pFormat);
if (pFormat == AV_SAMPLE_FMT_U8)
outFormat = "u8";
else if (pFormat == AV_SAMPLE_FMT_S32)
outFormat = "s32";
else if (pFormat == AV_SAMPLE_FMT_FLT)
outFormat = "f32";
else if (pFormat == AV_SAMPLE_FMT_DBL)
outFormat = "f64";
filterDescription_ filterDescription_
= "[ input ] aformat=sample_fmts=s16:sample_rates=" + std::to_string(midSampleRate) = "[ input ] aformat=sample_fmts=s16:sample_rates=" + std::to_string(midSampleRate)
+ ":channel_layouts=stereo [ resample1 ] , " + ":channel_layouts=stereo [ resample1 ] , "
"[ resample1 ] [ ir0 ] afir=maxir=1:wet=10:dry=10:irgain=1:irfmt=mono:maxp=" + "[ resample1 ] [ ir0 ] afir=maxir=1:wet=10:dry=10:irgain=1:irfmt=mono:maxp="
+ std::to_string(rSamples) + ":minp=" + std::to_string(rSamples) + std::to_string(rSamples) + ":minp=" + std::to_string(rSamples) + " [ reverb ] , "
+ " [ reverb ] , " + "[ reverb ] aformat=sample_fmts=" + outFormat + ":sample_rates="
#ifdef __DEBUG__
"[ reverb ] aformat=sample_fmts=" + outFormat + "p:sample_rates="
#else
"[ reverb ] aformat=sample_fmts=" + outFormat + ":sample_rates="
#endif
+ std::to_string(pSampleRate) + ":channel_layouts=stereo "; + std::to_string(pSampleRate) + ":channel_layouts=stereo ";
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"id": "AudioFilter", "id": "AudioFilter",
"name": "{{name}}", "name": "{{name}}",
"description": "{{description_summary}}", "description": "{{description_summary}}",
"version": "1.0.1", "version": "1.0.2",
"iconPath": "icon.svg", "iconPath": "icon.svg",
"backgroundPath": "background.jpg" "backgroundPath": "background.jpg"
} }
\ No newline at end of file
{ {
"name": "AudioFilter", "name": "AudioFilter",
"version": "1.0.1", "version": "1.0.2",
"extractLibs": false, "extractLibs": false,
"deps": [ "deps": [
"fmt", "fmt",
......
daemon @ f19b0fad
Subproject commit dc2697c3de77301d3881d01741c912a70226892e Subproject commit f19b0fad9b99181e9a5e5a892ae354d940db2bb2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment