Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Luccifer/SonogramView
Audio visualisation of song
https://github.com/Luccifer/SonogramView
audio bezier bpm fourier-transform ios macos path songs sonogram swift swift3 swift4
Last synced: about 1 month ago
JSON representation
Audio visualisation of song
- Host: GitHub
- URL: https://github.com/Luccifer/SonogramView
- Owner: Luccifer
- License: mit
- Created: 2017-09-01T17:05:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-09T17:52:20.000Z (over 7 years ago)
- Last Synced: 2024-11-24T01:41:36.112Z (about 2 months ago)
- Topics: audio, bezier, bpm, fourier-transform, ios, macos, path, songs, sonogram, swift, swift3, swift4
- Language: Swift
- Size: 34.2 KB
- Stars: 67
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - SonogramView - Audio visualisation of song. (Media / Audio)
- awesome-ios-star - SonogramView - Audio visualisation of song. (Media / Audio)
README
![](https://img.shields.io/badge/swift-3.0.1-green.svg)
# SonogramView
Audio visualisation of song![](https://github.com/Luccifer/SonogramView/blob/master/Screen%20Shot%202017-09-01%20at%2023.35.47.png)
## 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..
```swift
let sView: SonogramView = SonogramView()
```
Provide your fileURL like:
```swift
sView.addDurationOfFileWith(url: fileUrl!)
```
And just invoke the magic!
```swift
sView.convertToPoints()
```# Playground:
Try it in Playground! :)```Swift
import PlaygroundSupportvar 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.centerPlaygroundPage.current.liveView = view // Showing in liveView with xCode Playground
```