-
-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swift implementation (IOS Equalizer) #784
Open
SimoneBressan
wants to merge
19
commits into
ryanheise:minor
Choose a base branch
from
Kuama-IT:swift_implementation
base: minor
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9c07d23
Apply patch from old repository
BreX900 ad92855
fix ios files
BreX900 791f56a
swiftformat
0e6ef2c
refactor remove old code
BreX900 4f91087
build can add me as a dependency using git
BreX900 09ef9f6
add stop and fix swift code
38238d3
Update FUNDING.yml
kuamanet 42d002b
add classes, moved in dedicated folder extensions, fix typos
63e6c5d
Keep darwin sources inside macos dir, since the symlink does not seem…
kuamanet 419134f
format
eea5023
Simple script to copy files from darwin folder to macos/ios folder
kuamanet 499bc1f
restore ios source
kuamanet d122d32
feat: start integrating new pod
16faf9e
feat(Darwin): add reverb, delay and distortion structures
kuamanet 5b8d451
feat(Darwin): allow to toggle write output to file feature
kuamanet f6a5bc8
feat(Darwin): expose information about audio effects
kuamanet 65aeb08
fix: missing mappings
BreX900 2ea1917
chore: use early returns
kuamanet 8d4deca
feat(ios): drop pod dep and directly include deps code
kuamanet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
github: ryanheise | ||
custom: [https://www.klaep.com/] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,12 @@ build/ | |
.flutter-plugins | ||
coverage | ||
pubspec.lock | ||
|
||
# IntelliJ | ||
.idea | ||
*.iml | ||
|
||
# VS Code | ||
.vscode | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -765,29 +765,39 @@ private void loudnessEnhancerSetTargetGain(double targetGain) { | |
((LoudnessEnhancer)audioEffectsMap.get("AndroidLoudnessEnhancer")).setTargetGain(targetGainMillibels); | ||
} | ||
|
||
// dB = 0.1 bels | 0.8 = Equalize the level between ios and android | ||
private short dbToMillibels(double value) { | ||
return (short)(Math.round(value * 100.0 * 0.8)); | ||
} | ||
|
||
// dB = 0.1 bels | 0.8 = Equalize the level between ios and android | ||
private double millibelsToDb(int value) { | ||
return (double)(Math.round(value / 100.0 / 0.8)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: double space between |
||
} | ||
|
||
private Map<String, Object> equalizerAudioEffectGetParameters() { | ||
Equalizer equalizer = (Equalizer)audioEffectsMap.get("AndroidEqualizer"); | ||
ArrayList<Object> rawBands = new ArrayList<>(); | ||
for (short i = 0; i < equalizer.getNumberOfBands(); i++) { | ||
rawBands.add(mapOf( | ||
"index", i, | ||
"lowerFrequency", (double)equalizer.getBandFreqRange(i)[0] / 1000.0, | ||
"upperFrequency", (double)equalizer.getBandFreqRange(i)[1] / 1000.0, | ||
"centerFrequency", (double)equalizer.getCenterFreq(i) / 1000.0, | ||
"gain", equalizer.getBandLevel(i) / 1000.0 | ||
"lowerFrequency", millibelsToDb(equalizer.getBandFreqRange(i)[0]), | ||
"upperFrequency", millibelsToDb(equalizer.getBandFreqRange(i)[1]), | ||
"centerFrequency", millibelsToDb(equalizer.getCenterFreq(i)), | ||
"gain", millibelsToDb(equalizer.getBandLevel(i)) | ||
)); | ||
} | ||
return mapOf( | ||
"parameters", mapOf( | ||
"minDecibels", equalizer.getBandLevelRange()[0] / 1000.0, | ||
"maxDecibels", equalizer.getBandLevelRange()[1] / 1000.0, | ||
"minDecibels", millibelsToDb(equalizer.getBandLevelRange()[0]), | ||
"maxDecibels", millibelsToDb(equalizer.getBandLevelRange()[1]), | ||
"bands", rawBands | ||
) | ||
); | ||
} | ||
|
||
private void equalizerBandSetGain(int bandIndex, double gain) { | ||
((Equalizer)audioEffectsMap.get("AndroidEqualizer")).setBandLevel((short)bandIndex, (short)(Math.round(gain * 1000.0))); | ||
((Equalizer)audioEffectsMap.get("AndroidEqualizer")).setBandLevel((short)bandIndex, dbToMillibels(gain)); | ||
} | ||
|
||
/// Creates an event based on the current state. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: double space between
return
and(short)
.