• Stars
    star
    308
  • Rank 131,211 (Top 3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created about 7 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DisPlayer is a customizable audio visualization component that works with recording and playing back audio files

DisPlayers-Audio-Visualizers

Made by Agilie CI Status Version License Platform

DisPlayers-Audio-Visualizers

DisPlayer is a customizable audio visualization component that works with recording and playing back audio files

Histogram Demo Rolling Demo Wave Dem WaveStroke Dem

The audio visualizer can be easily embedded into an app that features:

  • audio comments to text or multimedia posts
  • recording and sending audio files in a chat
  • playing back audio files posted in a chat using a dedicated UI component

DisPlayer features 5 default visualization presets that can be customized by the background color (single tone or gradient), the wave color, the number of the wave’s bins/bars, and the wave amplitude.

Installation

The control can be easily embedded into an app:

# For latest release in cocoapods
pod 'DisPlayers-Audio-Visualizers', '~> 0.1.1'

Getting started

Getting started guide for DisPlayers-Audio-Visualizers

  1. You should added next classes into your project:
#import "EZAudio.h" 
#import "DPMainEqualizerView.h"
#import "DPEqualizerSettings.h"
  1. This library contains four types of equalizer visualisation: (Histogram, Rolling, Wave and Circle Wave). And you should chose want kind of equalizer visualization you want and import that class into your project.

Histogram initialization example:

    DPEqualizerSettings *settings = [DPEqualizerSettings createByType: DPHistogram];
    self.equalizerView = [[DPHistogramEqualizerView alloc] initWithFrame: self.view.bounds 
                                                             andSettings: settings];
    [self.view addSubview: self.equalizerView];
     NSString *audioPath = [[NSBundle mainBundle] pathForResource: @"YOUR_AUDIO_FILE_PATH" 
                                                           ofType: @"AUDIO_FILE_TYPE"];
     EZAudioFile *audioFile = [[EZAudioFile alloc] initWithURL: [[NSURL alloc] initWithString: audioPath]];
     self.player = [[EZAudioPlayer alloc] initWithAudioFile: audioFile];
     self.player.delegate = self;
     [self.player play];

EZAudioPlayerDelegate

- (void)  audioPlayer:(EZAudioPlayer *)audioPlayer
          playedAudio:(float **)buffer
       withBufferSize:(UInt32)bufferSize
 withNumberOfChannels:(UInt32)numberOfChannels
          inAudioFile:(EZAudioFile *)audioFile {
          
    dispatch_async(dispatch_get_main_queue(), ^{
        if (self.player.isPlaying) {
            [self.equalizerView updateBuffer: buffer[0] withBufferSize:bufferSize];
        }
    
    });
}
  1. You can also customize equalizer visualisation. You can change default settings for all equalizer visualisation types:
/// The highest bound of the frequency. Default: 7000Hz
@property (nonatomic) float maxFrequency;

/// The lowest bound of the frequency. Default: 400Hz
@property (nonatomic) float minFrequency;

/// The number of bins in the audio plot. Default: 40
@property (nonatomic) NSUInteger numOfBins;

/// The padding of each bin in percent width. Default: 0.2
@property (nonatomic) CGFloat padding;

/// The gain applied to the height of each bin. Default: 10
@property (nonatomic) CGFloat gain;

/// A float that specifies the vertical gravitational acceleration applied to each bin.
/// Default: 10 pixel/sec^2
@property (nonatomic) float gravity;

/// The number of max bin height. Default: Screen height.
@property (assign, nonatomic) CGFloat maxBinHeight;

/// The type of plot that can be displayed in the view using the data. Default: DPPlotTypeBuffer.
@property (assign, nonatomic) DPPlotType plotType;

/// The type of equalizer that can be displayed in the view using the data. Default: DPHistogram.
@property (assign, nonatomic) DPEqualizerType equalizerType;

/// The colors of equalizer background that can be displayed in the view.
@property (nonatomic, strong) NSMutableArray *equalizerBackgroundColors;

/// The colors of low frequency that can be displayed in the view.
@property (nonatomic, strong) NSMutableArray *lowFrequencyColors;

/// The colors of hight frequency that can be displayed in the view.
@property (nonatomic, strong) NSMutableArray *hightFrequencyColors;

/// The colors of bins that can be displayed in the view.
@property (nonatomic, strong) NSMutableArray *equalizerBinColors;

@property (nonatomic, assign) BOOL fillGraph;

Some presets display audio frequencies as a separate waves, which provides more possibilities for cool sound visualization for your project.

Usage

CocoaPods is the recommended way to add DisPlayer to your project:

  1. Add a pod entry for DisPlayer to your Podfile pod 'DisPlayer'
  2. Install the pod(s) by running pod installation.
  3. Include DisPlayer wherever you need it with #import «Equalizers.h».

Requirements

DisPlayer works on iOS 8.0+ and is compatible with ARC projects. It depends on the following Apple frameworks, which should already be included with most Xcode templates: CoreGraphics.framework QuartzCore.framework CoreAudio.framework You will need LLVM 3.0 or later in order to build “DisPlayer”

Author

This library is open-sourced by Agilie Team [email protected]

Contributors

Michael Liptuga - [email protected]

Contact us

[email protected]

License

The MIT License (MIT) Copyright © 2017 Agilie Team

More Repositories

1

AGCircularPicker

AGCircularPicker is helpful component for creating a controller aimed to manage any calculated parameter
Swift
625
star
2

AGImageControls

cool tools for image edition
Swift
227
star
3

AGVolumeControlView

Visual regulator can be connected to a player or other smart house’s device making the process of controlling the level of a particular characteristic
Swift
172
star
4

AGInterfaceInteraction

library performs interaction with UI interface
Swift
156
star
5

AGLocationDispatcher

Location manage framework working in different modes
Objective-C
149
star
6

instagram_api_gem

A Ruby wrapper for the Instagram API
Ruby
104
star
7

CircularPicker

CircularPicker is helpful for creating a controller aimed to manage any calculated parameter.
Kotlin
83
star
8

VolumeControlView

Visual regulator can be connected to a player or other smart house’s device making the process of controlling the level of a particular characteristic much easier.
Kotlin
75
star
9

dribbble-ios-sdk

Unofficial Dribbble iOS wrapper allows you to integrate Dribble API into iOS application (Designer, Shot, Comment, User Story, Like, Follow)
Objective-C
73
star
10

InterfaceInteraction

Interact your app's interface elements with different effects!
Kotlin
57
star
11

RotatableAutofitEditText

Extended EditText which allows to move, rotate and resize text at the same time
Java
53
star
12

GoButton

This button is used for displaying an animation while a request is going. It could be run with infinite animation loop or with finish animation as well.
JavaScript
51
star
13

MobileGift

Simplifies interaction with GIF images.
Kotlin
46
star
14

canvas-image-cover-position

Calculating image position for scaling it on the canvas.
HTML
39
star
15

AGMobileGiftInterface

simplified interaction with GIF animations
Swift
39
star
16

dribbble-android-sdk

Dribbble Android SDK is an unofficial wrapper for Dribbble API v1. (Designer, Shot, Comment, User Story, Like, Follow)
Java
31
star
17

AnimatedToggleMenu

The Animated Toggle Menu is helpful for creating websites. It’s lightweight, easy-to-use and requires minimum lines of code.
CSS
28
star
18

PXSDK

Objective-C
27
star
19

science-fiction-magazines-blog

Blog template (concept) is inspired by stylish science fiction magazines of the 80-90s.
CSS
26
star
20

gtm-in-viewport-manager

A manager of in-viewport events for GTM (Google Tag Manager).
HTML
21
star
21

Web-Time-Tracker

Plugin named Timetracker is a time counter that works in both increase and decrease directions.
JavaScript
21
star
22

Rails-Application-Template

Base template for creating rails applications.
Ruby
18
star
23

ng2-dialog-window

Modal/dialog windows and popups module for Angular applications.
JavaScript
17
star
24

Bouncing-Carousel

The bouncing carousel is an experiment with SVG animations technology.
CSS
14
star
25

viper_sample

Swift
10
star
26

electrum-proxy-middleware

ExpressJS middleware to add functionality for proxying requests to Electrum servers
TypeScript
7
star
27

vimeo-api-gem

A Ruby wrapper for the Vimeo API. Utilizes v3 API version
Ruby
6
star
28

AIS-MobileDesign

A Mobile Design API client for Agilie IT School teaching purposes
JavaScript
5
star
29

Agilie-IT-School

A sandbox repository for experiments with AngularJS techniques and studying purposes for Agilie IT School students
HTML
4
star
30

swift_viper_template

The template for creating VIPER module using generamba in Swift
Liquid
4
star
31

kraken-wsclient-js

Kraken WebSockets client in JS for the Kraken websocket API.
TypeScript
2
star
32

rails-generators

Rails ready-to-use generators to improve adding libs that we are usually using
Ruby
2
star
33

angular-helpies

Helping instances for developing Angular applications
HTML
2
star
34

action-button

JavaScript
1
star