A drop-in universal library allows to record audio within the app with a nice User Interface.

Overview

Icon

IQAudioRecorderController

IQAudioRecorderController is a drop-in universal library allows to record and crop audio within the app with a nice User Interface. There are also optional callback delegate methods to return recorded file path.

Idle Recording Playing No Access

Installation

CocoaPods

You can use CocoaPods to install IQAudioRecorderController by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!
pod 'IQAudioRecorderController'

To get the full benefits import IQAudioRecorderController wherever you import UIKit

import UIKit
import IQAudioRecorderController

Manually

  1. Download and drop /IQAudioRecorderControllerfolder in your project.
  2. Congratulations!

Supported format

Currently IQAudioRecorderController library only support .m4a file format.

Customization

There are optional properties to customize the appearance according to your app theme.

barStyle: UIBarStyle: Library support light and dark style UI for user interface. If you would like to present light style UI then you need to set barStyle to UIBarStyleDefault, otherwise dark style UI is the default.

normalTintColor: UIColor: This tintColor is used for showing wave tintColor while not recording, it is also used for top navigationBar and bottom toolbar tintColor.

highlightedTintColor: UIColor: Highlighted tintColor is used when playing recorded audio file or when recording audio file.

How to use

There are two seprate classes to Record and Crop Audio files.

To Record audio file, try something like this:-

#import "IQAudioRecorderViewController.h"

@interface ViewController ()<IQAudioRecorderViewControllerDelegate>
@end

@implementation ViewController

- (void)recordAction:(id)sender {
    IQAudioRecorderViewController *controller = [[IQAudioRecorderViewController alloc] init];
    controller.delegate = self;
    controller.title = "Recorder";
    controller.maximumRecordDuration = 10;
    controller.allowCropping = YES;
//    controller.barStyle = UIBarStyleDefault;
//    controller.normalTintColor = [UIColor magentaColor];
//    controller.highlightedTintColor = [UIColor orangeColor];
    [self presentBlurredAudioRecorderViewControllerAnimated:controller];
}

-(void)audioRecorderController:(IQAudioRecorderViewController *)controller didFinishWithAudioAtPath:(NSString *)filePath {
    //Do your custom work with file at filePath.
    [controller dismissViewControllerAnimated:YES completion:nil];
}

-(void)audioRecorderControllerDidCancel:(IQAudioRecorderViewController *)controller {
    //Notifying that user has clicked cancel.
    [controller dismissViewControllerAnimated:YES completion:nil];
}

@end

To Crop audio file, try something like this:-

#import "IQAudioCropperViewController.h"

@interface ViewController ()<IQAudioCropperViewControllerDelegate>
@end

@implementation ViewController

-(void)cropAction:(id)item {
    IQAudioCropperViewController *controller = [[IQAudioCropperViewController alloc] initWithFilePath:filePath];
    controller.delegate = self;
    controller.title = "Edit";
//    controller.barStyle = UIBarStyleDefault;
//    controller.normalTintColor = [UIColor magentaColor];
//    controller.highlightedTintColor = [UIColor orangeColor];
    [self presentBlurredAudioCropperViewControllerAnimated:controller];
}

-(void)audioCropperController:(IQAudioCropperViewController *)controller didFinishWithAudioAtPath:(NSString *)filePath {
    //Do your custom work with file at filePath.
    [controller dismissViewControllerAnimated:YES completion:nil];
}

-(void)audioCropperControllerDidCancel:(IQAudioCropperViewController *)controller {
    //Notifying that user has clicked cancel.
    [controller dismissViewControllerAnimated:YES completion:nil];
}

@end

Attributions

Thanks to Stefan Ceriu for his brilliant SCSiriWaveformView library.

Thanks to William Entriken for his FDWaveformView library.

LICENSE

Distributed under the MIT license. See LICENSE for more information.

Contributions

Any contribution is more than welcome! You can contribute through pull requests and issues on GitHub.

Author

If you wish to contact me, email at: [email protected]

Comments
  • IQAudioCropperController sometimes can't open

    IQAudioCropperController sometimes can't open

    when you already have a record, then if you click the CropButton in the Demo frequently, it will stay the loadingView and never appear the FDWaveformView; record_issue2

    bug 
    opened by J8rry 11
  • Modularization and customization

    Modularization and customization

    I'm planning to use your IQAudioRecorderController in my new app. That app has already a UINavigationController in place and I wanted to push the recorder onto it instead of presenting it modally.

    I implemented that change and, while on it, tweaked a bit here and there.

    What do you think?

    opened by sebastianludwig 10
  • Problem in opening the trim view controller for an existing audio

    Problem in opening the trim view controller for an existing audio

    Getting repeatedly error : IQ_FDWaveformView could not load asset: The requested URL was not found on this server. // Using a button to call function cropAction with the url of the media Item

    @IBAction func crop(_ sender: Any) {

        cropAction("file:///private/var/mobile/Containers/Data/Application/97E1CAB1-661A-477A-9CCE-C8CFED70E309/tmp/E04AA047-BCA2-4DC7-A53F-D6591D9A8DFB.m4a"!)
    }
    
    func cropAction(_ item: Any) {
        //    let controller = IQAudioCropperViewController(filePath: item as! String)
        let controller = IQAudioCropperViewController.init(filePath: item as! String)
        
        controller.delegate = self
        controller.title = "Edit"
        controller.barStyle = UIBarStyle.default
        
        controller.normalTintColor = UIColor.magenta
        controller.highlightedTintColor = UIColor.orange;
        
        
        presentBlurredAudioCropperViewControllerAnimated(controller)
    }
    
    func audioCropperController(_ controller: IQAudioCropperViewController, didFinishWithAudioAtPath filePath: String) {
        //Do your custom work with file at filePath.
        controller.dismiss(animated: true) { _ in }
    }
    
    func audioCropperControllerDidCancel(_ controller: IQAudioCropperViewController) {
        //Notifying that user has clicked cancel.
        controller.dismiss(animated: true) { _ in }
    }
    
    opened by credo92 7
  • property 'maximumRecordDuration' is not available to IQAudioRecorderController in Swift

    property 'maximumRecordDuration' is not available to IQAudioRecorderController in Swift

    I am using this library in my Swift 2.2-based app, and it works beautifully, however, I found the property maximumRecordDuration is not available for an instance of IQAudioRecorderController to use.

    I am wondering if it is possible to use maximumRecordDuration for Swift-based app. Thanks!

    opened by rcholic 6
  • Can't specify file format.

    Can't specify file format.

    Hello @hackiftekhar

    How are you?

    Your library is simple and useful. I think it will be better if you add to specify audio file format. Current, it is only possible to record for m4a, but I need mp3.

    I have seen your code, it can modify myself, but I want to use your library if possible.

    Thank you.

    question 
    opened by Ying1986 6
  • audio duration silider

    audio duration silider

    I'm using IQAudioRecorderController on a swift project like this:

     let controller = IQAudioRecorderViewController()
     controller.delegate = self
     controller.allowCropping = false
     controller.barStyle = UIBarStyle.black
     self.presentBlurredAudioRecorderViewControllerAnimated(controller)
    

    But I have a problem while playing recorded audio, it looks like that:

    screen shot 2018-04-22 at 4 19 26 pm

    Does somebody had this problem? Thank you

    opened by EgzonArifi 5
  • Microphone icon is not displayed

    Microphone icon is not displayed

    Microphone icon is not displayed

    My code:

        func audioRecordAction() {
            let audioRecorderController = IQAudioRecorderController()
            audioRecorderController.delegate = self
            audioRecorderController.title = "Audio Recorder"
            audioRecorderController.barStyle = UIBarStyle.BlackOpaque
            presentViewController(audioRecorderController, animated: true, completion: nil)
        }
    
    opened by CrazyWisdom 5
  • recording length

    recording length

    it would be greate if we can specify the maximum recording time allowed in seconds when the controller stops recording by itself, it will make it perfect i guess with many uses

    opened by nelzaatari 4
  • Adding support for wav audio format

    Adding support for wav audio format

    Hi @hackiftekhar:

    Thanks for providing cool library for the voice recorder.

    I have a use case of generating audio file as .wav. Enabled the support for .wav format

    Can you please review this PR and merge the same. Please let me know in case any discussion is needed.

    Thanks </ Pranav >

    opened by prscX 3
  • Demo app doesn't compile.

    Demo app doesn't compile.

    I am not sure if anything else needs to be done, but the demo app cannot be compiled for me. It failed to find a few classes (FDWaveformView and AV classes).

    opened by johnnielin 3
  • Please expose strings for localization

    Please expose strings for localization

    There are a few strings like "Delete Recording", "Cancel" or "Microphone Access Denied!". Could you please expose those so that we can localize them?

    enhancement 
    opened by luzianscherrer 2
  • > Can you please try the latest version of library because I fixed something like this couple of weeks ago.

    > Can you please try the latest version of library because I fixed something like this couple of weeks ago.

    Can you please try the latest version of library because I fixed something like this couple of weeks ago.

    Im using the latest one can we decrease the wave height because i just need a height to be constant. its overlapping my texts

    Originally posted by @seemanraj in https://github.com/hackiftekhar/IQAudioRecorderController/issues/52#issuecomment-614602864

    opened by seemanraj 0
  • How to limit record time with Audiorecord as mediarecorder with setmaxduration.

    How to limit record time with Audiorecord as mediarecorder with setmaxduration.

    I need to stop audio-record after 70 second from the starting time. With mediarecorder I used setMaxduration and this work well,

    How can I a good a good approach with AudioRecord too.

    Many Thanks for your help.

    opened by jingle30101 0
  • bitRate not work

    bitRate not work

    IQAudioRecorderViewController *controller = [[IQAudioRecorderViewController alloc] init];
    controller.delegate = self;
    controller.title = @"Recorder";
    controller.bitRate=128000;
    controller.sampleRate=8000;
    controller.maximumRecordDuration = 60*10;
    controller.numberOfChannels=2;
    controller.allowCropping = YES;
    

    when I set bitRate,the recorder not work.

    opened by bandy101 0
  • New functionalities

    New functionalities

    It would be nice if we could add some more functionalities, like:

    • A callback for when user has reached the time limit on recording
    • Possibility to open the trim view controller from an existing audio
    • Possibility to override icons
    enhancement 
    opened by githubdoramon 3
Owner
Mohd Iftekhar Qurashi
Everyone has their own strength, weakness and unique skills, that's what make them special.
Mohd Iftekhar Qurashi
Creating Custom Audio Effects - Simple Universal Version (Mac Catalyst)

Creating Custom Audio Effects - Simple Universal Version (Mac Catalyst) Adaptation of the sample provided by Apple Creating Custom Audio Effects. Ever

Fred Anton Corvest (FAC) 19 Nov 2, 2022
The Amazing Audio Engine is a sophisticated framework for iOS audio applications, built so you don't have to.

Important Notice: The Amazing Audio Engine has been retired. See the announcement here The Amazing Audio Engine The Amazing Audio Engine is a sophisti

null 523 Nov 12, 2022
AudiosPlugin is a Godot iOS Audio Plugin that resolves the audio recording issue in iOS for Godot Engine.

This plugin solves the Godot game engine audio recording and playback issue in iOS devices. Please open the Audios Plugin XCode Project and compile the project. You can also use the libaudios_plugin.a binary in your project.

null 3 Dec 22, 2022
PitchPerfect - A simple iOS app for the Udacity Nanodegree which explores AVFoundation to record a short sound

PitchPerfect App A simple iOS app for the Udacity Nanodegree which explores AVFo

Mark Han 0 Feb 12, 2022
WaggleTunes - Opensource version of WaggleTunes tweak - Universal Music Controller

WAGGLETUNES By Hallie WaggleTunes is a system-wide music controller for iOS, originally released on Packix for $1.25, which is now opensource and free

Hallie 1 Dec 29, 2021
This app demonstrates how to use the Google Cloud Speech API and Apple on-device Speech library to recognize speech in live recorded audio.

SpeechRecognitionIOS This app demonstrates how to use Google Cloud Speech API and Apple on-device Speech library to recognize speech in live audio rec

Josh Uvi 0 Mar 11, 2022
Beethoven is an audio processing Swift library

Beethoven is an audio processing Swift library that provides an easy-to-use interface to solve an age-old problem of pitch detection of musical signals.

Vadym Markov 735 Dec 24, 2022
YiVideoEditor is a library for rotating, cropping, adding layers (watermark) and as well as adding audio (music) to the videos.

YiVideoEditor YiVideoEditor is a library for rotating, cropping, adding layers (watermark) and as well as adding audio (music) to the videos. YiVideoE

coderyi 97 Dec 14, 2022
Subsonic is a small library that makes it easier to play audio with SwiftUI

Subsonic is a small library that makes it easier to play audio with SwiftUI

Paul Hudson 218 Dec 16, 2022
AIB indicates for your app users which audio is playing. Just like the Podcasts app.

Audio Indicator Bars for iOS and tvOS Indicates for your app users which audio is playing. Just like the Podcasts app. Index Requirements and Details

Leonardo Cardoso 285 Nov 23, 2022
FDWaveformView is an easy way to display an audio waveform in your app

FDWaveformView is an easy way to display an audio waveform in your app. It is a nice visualization to show a playing audio file or to select a position in a file.

William Entriken 1.1k Dec 21, 2022
Voice Memos is an audio recorder App for iPhone and iPad that covers some of the new technologies and APIs introduced in iOS 8 written in Swift.

VoiceMemos Voice Memos is a voice recorder App for iPhone and iPad that covers some of the new technologies and APIs introduced in iOS 8 written in Sw

Zhouqi Mo 322 Aug 4, 2022
App for adding and listening audio files

SomeSa SomeSa (самса) – приложение, позволяющее загружать и воспроизводить произвольные аудиофайлы. Протестировано на форматах файлов .wav и .mp3, раз

Yegor Dobrodeyev 0 Nov 7, 2021
KeyAudioManager - A swift package to make it a lot easier to play audio in your app

KeyAudioManager A swift package to make it a lot easier to play audio in your ap

Pedro Esli 3 Apr 28, 2022
AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS, and tvOS.

AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS (including Catalyst), and tvOS. Installation To add AudioKit

AudioKit 9.5k Dec 31, 2022
AudioPlayer is syntax and feature sugar over AVPlayer. It plays your audio files (local & remote).

AudioPlayer AudioPlayer is a wrapper around AVPlayer. It also offers cool features such as: Quality control based on number of interruption (buffering

Kevin Delannoy 676 Dec 25, 2022
AudioPlayer is a simple class for playing audio in iOS, macOS and tvOS apps.

AudioPlayer AudioPlayer is a simple class for playing audio in iOS, macOS and tvOS apps.

Tom Baranes 260 Nov 27, 2022
SwiftAudioPlayer - Swift-based audio player with AVAudioEngine as its base

SwiftAudioPlayer Swift-based audio player with AVAudioEngine as its base. Allows for: streaming online audio, playing local file, changing audio speed

null 417 Jan 7, 2023
Swift audio synthesis, processing, & analysis platform for iOS, macOS and tvOS

AudioKit AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS (including Catalyst), and tvOS. Installation To add AudioKit

AudioKit 8.7k Sep 30, 2021