Skip to content

pavan-kumar-arepu/AudioRecorderPavanKumar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

App Audio Recorder

Introduction

This application is designed to record, play, rename, and delete audio recordings on an iOS device. It includes a user-friendly UI with meaningful images and gradients for a better user experience.

Architecture Overview

The application consists of the following main components:

  • RecorderViewModel: Manages the recording process.
  • RecordingsListViewModel: Manages the list of recordings and handles renaming and deleting.
  • PlayerViewModel: Manages the playback of recordings.
  • Views: Various SwiftUI views to interact with the user.

TechStack

The application consists of the following technologies, languages and main concepts:

  • Swift
  • SwiftUI
  • Combine
  • UIKit
  • ObjectiveC
  • Background audio Recording
  • Audio Crash Resistance
  • Consise Audio file size

Class and Method Explanations

RecorderViewModel

Handles audio recording functionalities.

Methods

  • startRecording(): Starts a new recording.
  • pauseRecording(): Pauses the ongoing recording.
  • resumeRecording(): Resumes the paused recording.
  • stopRecording(): Stops the recording and saves it.

RecordingsListViewModel

Manages the list of recordings and provides functionalities to rename and delete recordings.

Methods

  • fetchRecordings(): Fetches the list of recordings from the document directory.
  • renameRecording(at index: Int, to newName: String): Renames a recording.
  • deleteRecording(at index: Int): Deletes a recording.

PlayerViewModel

Handles audio playback functionalities.

Methods

  • playAudio(): Plays the selected audio recording.
  • pauseAudio(): Pauses the audio playback.

Views

RecorderView

A view that provides the UI for recording audio.

RecordingsListView

A view that displays the list of recordings and provides options to rename and delete.

PlayerView

A view that provides the UI for playing audio recordings.

VolumeMeterView

A view that visualizes the audio levels during recording.

RenameRecordingView

A view that allows the user to rename a recording.

Non-Functional Requirements

1. Save Most of the Audio Recording if the App Crashes or is Killed

To ensure audio recordings are saved even if the app crashes or is killed, we use the following approach:

  • Periodic Saving: The recording is periodically saved to a temporary file. In case of an unexpected termination, the last saved state can be recovered.
  • Auto-Restart: On app launch, check for any temporary recordings and prompt the user to save or discard them.

2. Minimize App Space Usage for Recordings

To minimize app space usage:

  • Compression: Recordings are saved in a compressed format (e.g., AAC).
  • File Management: Users can delete recordings they no longer need, freeing up space.

App Screenshots

Recording List

Recorder States

Player States

Sequence Diagrams

Recording

Recorder

Playing

Playback

Renaming

Rename

Delete

Delete

Bonus

  • Rename File Functionality Implemented: Allows users to rename their recordings.
  • Delete File Functionality Implemented: Allows users to delete their recordings.
  • Added Meaningful Images: Enhanced UI with appropriate images.
  • Added Gradient for Better UI: Gradient background for a visually appealing UI.

Contact

About

Building Audio Recorder App using SwiftUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages