Git Product home page Git Product logo

avaudio-equalizer's Introduction

AVAudio+Equalizer Example for iOS / Swift

License Platform

This repository is an iOS sample project that contrains how to use equalizer options created by HanSJin.

๐Ÿ“ฑ Screenshots

Normal Enjoy Customizing
A screenshot of AVAudio+Equalizer A screenshot of AVAudio+Equalizer

โš ๏ธ Caution !!

โš ๏ธ After the build, the music will play automatically โš ๏ธ

๐Ÿ“Ž Code Examples

You can simply create an AudioEngine+Equalizer.

let audioManager = AudioManager(music: "bensound-energy")
audioManager.delegate = self
audioManager.setEquailizerOptions(gains: preSets[0])
audioManager.engineStart()
audioManager.play()

Here are sample preset options. Also you can test the detail value of equalizer by moving the UISlider in this project.

let frequencies: [Int] = [32, 63, 125, 250, 500, 1000, 2000, 4000, 8000, 16000]
var preSets: [[Float]] = [
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // My setting
    [4, 6, 5, 0, 1, 3, 5, 4.5, 3.5, 0], // Dance
    [4, 3, 2, 2.5, -1.5, -1.5, 0, 1, 2, 3], // Jazz
    [5, 4, 3.5, 3, 1, 0, 0, 0, 0, 0] // Base Main
]

And can call the delegate.

func audioManager(didStart manager: AudioManager) {
    print("music play")
}

func audioManager(didStop manager: AudioManager) {
    print("music stop")
}

func audioManager(didPause manager: AudioManager) {
    print("music pause")
}

Getter/Setter for the equalizer options are provided too.

var preSet = audioManager.getEquailizerOptions()
preSet[0] = 0.5 // +0.5 dB
audioManager.setEquailizerOptions(gains: preSet)

Music

This project contains bensound-energy.mp3 as sound sample. You can check the source of this music here.

License

AVAudio+Equalizer is released under the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.