All Projects → benoit-pereira-da-silva → Soundwaveform

benoit-pereira-da-silva / Soundwaveform

Licence: mit
Generate WaveForms Images from Sounds and Videos on macOS and iOS (Swift 5.x)

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Soundwaveform

denver.lua
a simple library to help you play custom waveforms with LÖVE
Stars: ✭ 66 (-44.54%)
Mutual labels:  waveform, sound
Akwf Free
Adventure Kid Wave Forms are a collection of sampled one cycle waveforms for use in synthesizers or similar sound generators.
Stars: ✭ 179 (+50.42%)
Mutual labels:  sound, waveform
Torch Audiomentations
Fast audio data augmentation in PyTorch. Inspired by audiomentations. Useful for deep learning.
Stars: ✭ 164 (+37.82%)
Mutual labels:  sound, waveform
Blipkit
C library for creating the beautiful sound of old sound chips
Stars: ✭ 23 (-80.67%)
Mutual labels:  sound, waveform
Thorium
Platform for starship simulator controls
Stars: ✭ 109 (-8.4%)
Mutual labels:  sound
Plotille
Plot in the terminal using braille dots.
Stars: ✭ 99 (-16.81%)
Mutual labels:  plot
Musicott
JavaFX application that manages and plays music files.
Stars: ✭ 97 (-18.49%)
Mutual labels:  waveform
Wesanderson
A Wes Anderson color palette for R
Stars: ✭ 1,343 (+1028.57%)
Mutual labels:  plot
Argos
Argos: a data viewer that can read HDF5, NetCDF4, and other file formats.
Stars: ✭ 118 (-0.84%)
Mutual labels:  plot
Implot
Immediate Mode Plotting
Stars: ✭ 2,014 (+1592.44%)
Mutual labels:  plot
Wad
Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
Stars: ✭ 1,540 (+1194.12%)
Mutual labels:  sound
Covid19 Dashboard
🦠 Django + Plotly Coronavirus dashboard. Powerful data driven Python web-app, with an awesome UI. Contributions welcomed! Featured on 🕶Awesome-list
Stars: ✭ 100 (-15.97%)
Mutual labels:  plot
Simple Sdl2 Audio
A simple SDL2 audio library without SDL_Mixer for playing music and multiple sounds natively in SDL2
Stars: ✭ 111 (-6.72%)
Mutual labels:  sound
Basetheme
Themes for base plotting system in R
Stars: ✭ 99 (-16.81%)
Mutual labels:  plot
Sound
🔊 A Vue composable for playing sound effects
Stars: ✭ 116 (-2.52%)
Mutual labels:  sound
Highcharts Chart
Polymer Element wrapper for highcharts library. Seamlessly create various types of charts from one element.
Stars: ✭ 97 (-18.49%)
Mutual labels:  plot
Grafica.js
A simple and configurable plotting library for p5.js
Stars: ✭ 106 (-10.92%)
Mutual labels:  plot
Jmathplot
Java interactive 2D and 3D plots (no OpenGL)
Stars: ✭ 113 (-5.04%)
Mutual labels:  plot
Cephalopod
A sound fader for AVAudioPlayer written in Swift for iOS, tvOS and macOS.
Stars: ✭ 103 (-13.45%)
Mutual labels:  sound
React Native Sound Recorder
Simplest Sound Recorder for React Native
Stars: ✭ 103 (-13.45%)
Mutual labels:  sound

Swift 5 Platform Carthage compatible

SoundWaveForm

Allows to extract sound samples from Video or Sounds files very efficiently (it relies on the Accelerate framework). SoundWaveForm expose an optimized cross platform drawing that renders the waveform into an Image.

It supports

  • macOS 10.11 & +
  • iOS 8 & +
  • swift 5.x
  • if you need to support swift 4 use v3.0.2
  • if you need to support swift 3 use the v2.0.1

Screen Shots

MacDown Screenshot MacDown Screenshot MacDown Screenshot

Usage sample

The framework is composed of a SamplesExtractor and a WaveFormDrawer.

// Configure the drawings
let configuration = WaveformConfiguration( size: waveFormView.bounds.size,
											backgroundColor: WaveColor.lightGray,
											color: WaveColor.red,
											style: .striped,
											position: .middle,
											scale: 1)

// Extract the downsampled samples
// Proceed to extraction
SamplesExtractor.samples(audioTrack: track,
        timeRange: nil,
        desiredNumberOfSamples: 500,
        onSuccess:{ samples, sampleMax, id in
        	// Let's display the waveform in a view                     
			self.waveFormView.image = WaveFormDrawer.image(from: samples, with: configuration)
        },
        onFailure: { error, id in 
            ... // Handle the error e.g: print("\(id ?? "") \(error)")
        }
)


How to extract sample from a specified timeRange?

You can define AVAssetReader.timeRange.

let asset = AVURLAsset(url: url)
let audioTracks:[AVAssetTrack] = asset.tracks(withMediaType: AVMediaTypeAudio)
if let track:AVAssetTrack = audioTracks.first{
		
		// Define the timeRange from second 1 to second 10
		let startTime = CMTime(seconds: 1, preferredTimescale: 1000)
		let endTime = CMTime(seconds: 10, preferredTimescale: 1000)
		let timeRange = CMTimeRangeMake(startTime, endTime)

		// Proceed to extraction (refer to previous code)
		SamplesExtractor.samples(audioTrack: track,
				timeRange:timeRange,
				desiredNumberOfSamples: 500,
				onSuccess:{ samples, sampleMax, id in
					... // Proceeed
				},
				onFailure: { error, id in 
					... // Handle the error
				}
		)
  
}

Installation

  • Via SPM: add https://github.com/benoit-pereira-da-silva/SoundWaveForm
  • Via Carthage: Add to your Cartfile github "benoit-pereira-da-silva/SoundWaveForm"
  • Copy the two source files : Sources/SoundWaveForm/

Inspiration

This project has been largely inspired by FDWaveformView and DSWaveformImage. Thanks to William aka @fulldecent and Daniel @dmrschmidt.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].