Git Product home page Git Product logo

reverseaudio's Introduction

ReverseAudio

Sceenshot

The user interface is multiplatform (macOS, iOS) SwiftUI.

Reverses audio and then reverses the reversed audio. The audio files reversed are in the app bundle, named:

"I'm Afraid I Can't Do That" and "Piano"

The method that reverses audio is an extension of AVAsset:

func reverseAudio(destinationURL:URL, progress: @escaping (Float) -> (), completion: @escaping (Bool, String?) -> ())

reverseAudio makes use of a key method that is an extension on CMSampleBuffer:

func reverse(timingInfo:[CMSampleTimingInfo]) -> CMSampleBuffer?

ReverseAudioObservable is an ObservableObject that performs the required tasks:

Plays and reverses the the audio files in response to buttons in the main view.

The files generated are placed in the app's Documents folder.

The app writes uncompressed audio, saving them to .wav files.

Main Window has three parts:

1 - Two buttons to reverse the two audio files in the app bundle.

2 - Two buttons to play the two audio files in the app bundle.

3 - Two buttons to play the reversed and reverse of the reversed audio files.

Note that the reversed reversed audio should sound like the original audio, as an inverse operation.

reverseaudio's People

Contributors

jpagliaro avatar

Stargazers

jihun avatar

Watchers

 avatar

reverseaudio's Issues

Not an issue, but could use some insight.

I was poking around for code that plays audio from SwiftUI and bumped into your repo. Interesting! I'm fairly new to SwiftUI and iOS in general. My objective is to play musical fragments in a looping fashion, where the fragments end up collectively sounding as a polyrhythm, given the loops overlap during playback. I'm struggling to construct a framework where I can sequence the audio loops (quite long) while firing additional loops at very precise intervals during the playback of a given loop such that the rhythm is precisely preserved, thus generating a complex polyrhythm because of the different time signatures of individual loop elements.

This sort of arrangement would permit me to have a seemingly "infinite" song with just 7 longish loop elements. I need to control the number of times a given loop fires while getting a notification of when a given loop cycle ends so I can fire, without any delay, a new loop element. If you're familiar with Steve Reich, this sort of arrangement of loop playback simulates his composition style. I'm unlikely to have more than 5 concurrent loops playing at any one time. I would need to be able to recycle a given player to play a new loop element. Given your familiarity with timing and buffering, I suspect you know the best approach.

I'm struggling to resolve which iOS API to use. Any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.