Audio visualisation of song

Overview

SonogramView

Audio visualisation of song

Requirements

  • iOS 8.0+
  • macOS 10.10+
  • Xcode 8.0+

Installation:

Manually

First

Check SonogramView.swift or MacSonogramView.swift and copy it to your project, then take a look on example for iOS or macOS, it's pretty straightforward, and don't forget to make sure, that you have your audiofile added to project/downloaded.

Second

You whould init anywhere the SonogramView() as nib or fram - doesnt matter..

let sView: SonogramView = SonogramView()

Provide your fileURL like:

sView.addDurationOfFileWith(url: fileUrl!)

And just invoke the magic!

sView.convertToPoints()

Playground:

Try it in Playground! :)

import PlaygroundSupport

var fileUrl: URL?
do {
    fileUrl = PlaygroundSupport.playgroundSharedDataDirectory.appendingPathComponent("test.m4a")
    // User/Documents/Shared Playground Data
} catch {
    print(error)
}


var waveView: SonogramView = SonogramView()
waveView.addDurationOfFileWith(url: fileUrl!)
waveView.convertToPoints()
// And you are done!

// Customization of view
waveView.backgroundColor = .clear
let view = UIView(frame: CGRect(x: 0, y: 0, width: 300, height: 200))
view.backgroundColor = .white
view.addSubview(waveView)

waveView.frame.size.width = view.frame.width
waveView.frame.size.height = view.frame.height
waveView.center = view.center

PlaygroundPage.current.liveView = view // Showing in liveView with xCode Playground
You might also like...
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

Swift audio synthesis, processing, & analysis platform for iOS, macOS and tvOS
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

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.
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

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

App for adding and listening audio files
App for adding and listening audio files

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

Painless high-performance audio on iOS and Mac OS X

An analgesic for high-performance audio on iOS and OSX. Really fast audio in iOS and Mac OS X using Audio Units is hard, and will leave you scarred an

Audio Filters on iOS and OSX

Audio Filters on iOS and OSX Implement high quality audio filters with just a few lines of code and Novocaine, or your own audio library of choice. NV

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

IQAudioRecorderController IQAudioRecorderController is a drop-in universal library allows to record and crop audio within the app with a nice User Int

AIB indicates for your app users which audio is playing. Just like the Podcasts app.
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

Comments
  • Documentation missing on how to animate

    Documentation missing on how to animate

    Hello, looking at the code there seems to be a shapeLayer added to the view which would allow for some kind of animation. I'm guessing the intent was to allow changing the color of the sonogram view while playing the audio clip. Do you have any sample code on how to achieve this effect?

    opened by ekscrypto 2
  • Better README

    Better README

    Hey @SonogramView, your lib is awesome but your README lacks an installation section I created this iOS README template to help you out 😉

    Please fix this issue before we can approve the AwesomeiOS PR

    opened by lfarah 1
Owner
Gleb Karpushkin
HTB:https://www.hackthebox.eu/profile/179935 ################ Developer married on Swift, bitten by C#, ganged by Haskell
Gleb Karpushkin
SimplePlayer - A simple application to fetch songs from iTunes Library by searching song's artist

SimplePlayer is a simple application to fetch songs from iTunes Library by searching song's artist.

Maria Angelina 0 Jan 30, 2022
Stem Player - An iOS app that can manipulate song stems.

Stem Player is an iOS app that can manipulate song stems

Thatcher Clough 9 Dec 1, 2022
Stem Player is an iOS app that can manipulate song stems

Stem Player Stem Player is an iOS app that can manipulate song stems. Demo Start Screen Add Song Stem Player How it works Stem Player is an iOS app th

Thatcher Clough 9 Dec 1, 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
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
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
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