Giter VIP home page Giter VIP logo

audio-player-example's Introduction

Audio Player Example

© 2021 Charles Pisciotta

A sample UIKit (iOS) app that allows a user to simply play locally stored audio files using AudioKit.


This project was put together for my interview with SoundMind before joining as an iOS Developer. The initial project requirements, some basic files, assets, and project skeleton were written and/or provided by SoundMind (Jack Zimmer and Jason Silberman). On receiving the project, I implemented all of the necessary files (i.e. audio playback, navigation, asset management, etc.), restructured the project, and added assets (i.e. the app icon and cover images for sounds).


This sample app displays a list of audio files that are stored locally. The home screen is a simple UITableViewController that lists the audio files as SoundTableViewCells. Each cell contains the name of the audio file and a PlayingIndicator. The latter is highlighted when currently playing and, at any given time, only one indicator can be highlighted as only one file can play at once. At the start, no audio plays, so all indicators start unhighlighted and all remain unhighlighted when no audio is playing.

On click of a SoundTableViewCell, a PlayerViewController is displayed modally. The PlayerViewController consists of the following UI elements: a background image consistent with the audio file, a large title at the top displaying the name of the audio file, and a button at the bottom allowing the user to play and pause the sound. When that specific audio file is playing, the button shows a pause icon; when that specific audio file is not playing, the button shows a play icon. Note, if an audio file is playing, only the modal view controller of that audio file will toggle the default button icon.


Launch Screen Home Screen with No Music Playing Home Screen with Music Playing Home Screen with Music Playing in Dark Mode Audio File Player Screen with No Music Playing Audio File Player Screen with Music Playing


Features

  • View locally stored audio files in a table view and determine which, if any, file is currently playing via the PlayingIndicator.
  • Play and pause audio files on click of a table view cell via a modally displayed PlayerViewController.

Known Bug

On startup and when playing audio, the following errors print to the console:

AddInstanceForFactory: No factory registered for id
AURemoteIO.h:323:entry: Unable to join I/O thread to workgroup ((null)): 2

This error was reported issue on GitHub and can be found here. It appears that this issue relates to using the simulator and might be unavoidable.


Development Process

Understanding

  1. Read the instructions to understand the scope of the problem, the features that need to be implemented, and any development constraints.
  2. Review the prewritten code to understand the structure of the codebase, the assets included, the technologies used, and the features that need to be implemented.
  3. Read the documentation for AudioKit to understand the basic use of the framework.

Design Preparation

  1. Create a basic sketch of what the sample detail view will look like when completed.

Development

  1. Create a model to hold the Audio File data. This includes the name of the file, the name of the image, and any other metadata.
  2. Develop the SoundTableViewCell to display a preview of the audio files.
  3. Develop the PlayerViewController to display a detailed view of the audio file, including its cover image, and to allow play/pause functionality.
  4. Complete the play and pause functions in CPAudioPlayer to allow for proper audio playback using AudioKit. This includes enabling playing in the background.

Testing

  1. Develop now, and throughout the process, unit tests to ensure that the code is functioning properly. In this case, unit tests were set up to ensure that each audio file was successfully played and paused.
  2. Use the app and determine any remaining issues, bugs, or improvements.

Documentation and Clean Up

  1. Write now, and throughout the process, documentation to help for readability and understanding.
  2. Ensure that all existing code is written cleanly and efficiently.

Final Deliverable

  1. Send the finished prototype for review.

Requirements

  • iOS 14.0+
  • Xcode 12.0+

Using the application

Download or clone the project to Xcode. Run the code on the simulator or a physical device.


Meta

Charles Pisciotta – Freelance iOS Developer – [email protected]

https://github.com/cpisciotta

audio-player-example's People

Contributors

cpisciotta avatar

Stargazers

 avatar

Watchers

 avatar

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.