项目作者: zhxnlai

项目描述 :
使用EZAudio的硬件加速音频可视化视图,受AudioCopy的启发。
高级语言: Objective-C
项目地址: git://github.com/zhxnlai/ZLHistogramAudioPlot.git
创建时间: 2014-10-27T08:34:47Z
项目社区:https://github.com/zhxnlai/ZLHistogramAudioPlot

开源协议:MIT License

下载


ZLHistogramAudioPlot

A hardware-accelerated audio visualization view using EZAudio, inspired by AudioCopy. ZLHistogramAudioPlot was originally developed for Murmur.

Preview

Buffer

preview buffer

Rolling

preview rolling

CocoaPods

You can install ZLHistogramAudioPlot through CocoaPods adding the following to your Podfile:

  1. pod 'ZLHistogramAudioPlot'

Usage

Checkout the demo app for an example.

Customizable attributes:

  1. /// The upper bound of the frequency range the audio plot will display. Default:
  2. /// 10000Hz
  3. @property (nonatomic) float maxFrequency;
  4. /// The lower bound of the frequency range the audio plot will display. Default:
  5. /// 1200Hz
  6. @property (nonatomic) float minFrequency;
  7. /// The number of bins in the audio plot. Default: 30
  8. @property (nonatomic) NSUInteger numOfBins;
  9. /// The padding of each bin in percent width. Default: 0.1
  10. @property (nonatomic) CGFloat padding;
  11. /// The gain applied to the height of each bin. Default: 10
  12. @property (nonatomic) CGFloat gain;
  13. /// A float that specifies the vertical gravitational acceleration applied to
  14. /// each bin. Default: 10 pixel/sec^2
  15. @property (nonatomic) float gravity;
  16. /// The color of all bins in the audio plot.
  17. @property (strong, nonatomic) UIColor *color;
  18. /// An array of color objects defining the color of each bin in the audio plot.
  19. /// If not set, the color attribute will be used instead. Currently only
  20. /// supported by plot type EZPlotTypeBuffer.
  21. @property (strong, nonatomic) NSArray *colors;

Dependencies

  • ZLHistogramAudioPlot is a subclass of EZAudioPlot. It requires EZAudio.
  • It also requires Accelerate framework for hardware acceleration.

Compatibilty

ZLHistogramAudioPlot uses the following interface provided by EZAudio to get audio data:

  1. - (void)updateBuffer:(float *)buffer withBufferSize:(UInt32)bufferSize;

It can be easily modified to work with Audio Unit and Core Audio.

Requirements

  • iOS 6 or higher.
  • Automatic Reference Counting (ARC).

License

ZLHistogramAudioPlot is available under the MIT license. See the LICENSE file for more info.