├── .gitignore ├── AudioWaveForm.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── AudioWaveForm ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── ic_Close.imageset │ │ ├── Contents.json │ │ └── ic_Close.png │ ├── ic_Music_Download.imageset │ │ ├── Contents.json │ │ └── ic_Music_Download.png │ └── waveform.imageset │ │ ├── Contents.json │ │ └── waveform.png ├── AudioWaveForm-Bridging-Header.h ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── Resources │ ├── SDDownloadManager │ │ ├── SDDownloadManager.swift │ │ ├── SDDownloadObject.swift │ │ └── SDFileUtils.swift │ └── SYWaveformPlayer │ │ ├── SCWaveformView.h │ │ ├── SCWaveformView.m │ │ ├── SYWaveformPlayerView.h │ │ ├── SYWaveformPlayerView.m │ │ ├── pausebutton.png │ │ └── playbutton.png └── ViewController.swift ├── AudioWaveFormTests ├── AudioWaveFormTests.swift └── Info.plist ├── AudioWaveFormUITests ├── AudioWaveFormUITests.swift └── Info.plist ├── LICENSE ├── README.md └── ScreenShorts ├── Simulator Screen Shot - iPhone 6s - 2019-02-04 at 21.08.11.png ├── Simulator Screen Shot - iPhone 6s - 2019-02-04 at 21.08.15.png └── Simulator Screen Shot - iPhone 6s - 2019-02-04 at 21.08.16.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | # Package.resolved 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | 51 | # Carthage 52 | # 53 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 54 | # Carthage/Checkouts 55 | 56 | Carthage/Build 57 | 58 | # fastlane 59 | # 60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 61 | # screenshots whenever they are needed. 62 | # For more information about the recommended setup visit: 63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 64 | 65 | fastlane/report.xml 66 | fastlane/Preview.html 67 | fastlane/screenshots/**/*.png 68 | fastlane/test_output 69 | -------------------------------------------------------------------------------- /AudioWaveForm.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 21053D2822088635006AFFB7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21053D2722088635006AFFB7 /* AppDelegate.swift */; }; 11 | 21053D2A22088635006AFFB7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21053D2922088635006AFFB7 /* ViewController.swift */; }; 12 | 21053D2D22088635006AFFB7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 21053D2B22088635006AFFB7 /* Main.storyboard */; }; 13 | 21053D2F22088637006AFFB7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 21053D2E22088637006AFFB7 /* Assets.xcassets */; }; 14 | 21053D3222088637006AFFB7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 21053D3022088637006AFFB7 /* LaunchScreen.storyboard */; }; 15 | 21053D3D22088637006AFFB7 /* AudioWaveFormTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21053D3C22088637006AFFB7 /* AudioWaveFormTests.swift */; }; 16 | 21053D4822088637006AFFB7 /* AudioWaveFormUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21053D4722088637006AFFB7 /* AudioWaveFormUITests.swift */; }; 17 | 21053D612208868A006AFFB7 /* pausebutton.png in Resources */ = {isa = PBXBuildFile; fileRef = 21053D5B2208868A006AFFB7 /* pausebutton.png */; }; 18 | 21053D622208868A006AFFB7 /* playbutton.png in Resources */ = {isa = PBXBuildFile; fileRef = 21053D5C2208868A006AFFB7 /* playbutton.png */; }; 19 | 21053D632208868A006AFFB7 /* SCWaveformView.m in Sources */ = {isa = PBXBuildFile; fileRef = 21053D5D2208868A006AFFB7 /* SCWaveformView.m */; }; 20 | 21053D642208868A006AFFB7 /* SYWaveformPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 21053D5E2208868A006AFFB7 /* SYWaveformPlayerView.m */; }; 21 | 21053D6822088693006AFFB7 /* SDDownloadObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21053D6522088693006AFFB7 /* SDDownloadObject.swift */; }; 22 | 21053D6922088693006AFFB7 /* SDFileUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21053D6622088693006AFFB7 /* SDFileUtils.swift */; }; 23 | 21053D6A22088693006AFFB7 /* SDDownloadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21053D6722088693006AFFB7 /* SDDownloadManager.swift */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | 21053D3922088637006AFFB7 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 21053D1C22088635006AFFB7 /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = 21053D2322088635006AFFB7; 32 | remoteInfo = AudioWaveForm; 33 | }; 34 | 21053D4422088637006AFFB7 /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = 21053D1C22088635006AFFB7 /* Project object */; 37 | proxyType = 1; 38 | remoteGlobalIDString = 21053D2322088635006AFFB7; 39 | remoteInfo = AudioWaveForm; 40 | }; 41 | /* End PBXContainerItemProxy section */ 42 | 43 | /* Begin PBXFileReference section */ 44 | 21053D2422088635006AFFB7 /* AudioWaveForm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AudioWaveForm.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 21053D2722088635006AFFB7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 46 | 21053D2922088635006AFFB7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 47 | 21053D2C22088635006AFFB7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 48 | 21053D2E22088637006AFFB7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 49 | 21053D3122088637006AFFB7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 50 | 21053D3322088637006AFFB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | 21053D3822088637006AFFB7 /* AudioWaveFormTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AudioWaveFormTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 21053D3C22088637006AFFB7 /* AudioWaveFormTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioWaveFormTests.swift; sourceTree = ""; }; 53 | 21053D3E22088637006AFFB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 21053D4322088637006AFFB7 /* AudioWaveFormUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AudioWaveFormUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 21053D4722088637006AFFB7 /* AudioWaveFormUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioWaveFormUITests.swift; sourceTree = ""; }; 56 | 21053D4922088637006AFFB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 21053D5822088678006AFFB7 /* AudioWaveForm-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AudioWaveForm-Bridging-Header.h"; sourceTree = ""; }; 58 | 21053D5B2208868A006AFFB7 /* pausebutton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pausebutton.png; sourceTree = ""; }; 59 | 21053D5C2208868A006AFFB7 /* playbutton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = playbutton.png; sourceTree = ""; }; 60 | 21053D5D2208868A006AFFB7 /* SCWaveformView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCWaveformView.m; sourceTree = ""; }; 61 | 21053D5E2208868A006AFFB7 /* SYWaveformPlayerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SYWaveformPlayerView.m; sourceTree = ""; }; 62 | 21053D5F2208868A006AFFB7 /* SYWaveformPlayerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SYWaveformPlayerView.h; sourceTree = ""; }; 63 | 21053D602208868A006AFFB7 /* SCWaveformView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCWaveformView.h; sourceTree = ""; }; 64 | 21053D6522088693006AFFB7 /* SDDownloadObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDDownloadObject.swift; sourceTree = ""; }; 65 | 21053D6622088693006AFFB7 /* SDFileUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDFileUtils.swift; sourceTree = ""; }; 66 | 21053D6722088693006AFFB7 /* SDDownloadManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDDownloadManager.swift; sourceTree = ""; }; 67 | /* End PBXFileReference section */ 68 | 69 | /* Begin PBXFrameworksBuildPhase section */ 70 | 21053D2122088635006AFFB7 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | 21053D3522088637006AFFB7 /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | 21053D4022088637006AFFB7 /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | ); 89 | runOnlyForDeploymentPostprocessing = 0; 90 | }; 91 | /* End PBXFrameworksBuildPhase section */ 92 | 93 | /* Begin PBXGroup section */ 94 | 21053D1B22088635006AFFB7 = { 95 | isa = PBXGroup; 96 | children = ( 97 | 21053D2622088635006AFFB7 /* AudioWaveForm */, 98 | 21053D3B22088637006AFFB7 /* AudioWaveFormTests */, 99 | 21053D4622088637006AFFB7 /* AudioWaveFormUITests */, 100 | 21053D2522088635006AFFB7 /* Products */, 101 | ); 102 | sourceTree = ""; 103 | }; 104 | 21053D2522088635006AFFB7 /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 21053D2422088635006AFFB7 /* AudioWaveForm.app */, 108 | 21053D3822088637006AFFB7 /* AudioWaveFormTests.xctest */, 109 | 21053D4322088637006AFFB7 /* AudioWaveFormUITests.xctest */, 110 | ); 111 | name = Products; 112 | sourceTree = ""; 113 | }; 114 | 21053D2622088635006AFFB7 /* AudioWaveForm */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 21053D5522088654006AFFB7 /* Resources */, 118 | 21053D2722088635006AFFB7 /* AppDelegate.swift */, 119 | 21053D2922088635006AFFB7 /* ViewController.swift */, 120 | 21053D2B22088635006AFFB7 /* Main.storyboard */, 121 | 21053D2E22088637006AFFB7 /* Assets.xcassets */, 122 | 21053D3022088637006AFFB7 /* LaunchScreen.storyboard */, 123 | 21053D3322088637006AFFB7 /* Info.plist */, 124 | 21053D5822088678006AFFB7 /* AudioWaveForm-Bridging-Header.h */, 125 | ); 126 | path = AudioWaveForm; 127 | sourceTree = ""; 128 | }; 129 | 21053D3B22088637006AFFB7 /* AudioWaveFormTests */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 21053D3C22088637006AFFB7 /* AudioWaveFormTests.swift */, 133 | 21053D3E22088637006AFFB7 /* Info.plist */, 134 | ); 135 | path = AudioWaveFormTests; 136 | sourceTree = ""; 137 | }; 138 | 21053D4622088637006AFFB7 /* AudioWaveFormUITests */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 21053D4722088637006AFFB7 /* AudioWaveFormUITests.swift */, 142 | 21053D4922088637006AFFB7 /* Info.plist */, 143 | ); 144 | path = AudioWaveFormUITests; 145 | sourceTree = ""; 146 | }; 147 | 21053D5522088654006AFFB7 /* Resources */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 21053D5722088664006AFFB7 /* SYWaveformPlayer */, 151 | 21053D562208865B006AFFB7 /* SDDownloadManager */, 152 | ); 153 | path = Resources; 154 | sourceTree = ""; 155 | }; 156 | 21053D562208865B006AFFB7 /* SDDownloadManager */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 21053D6722088693006AFFB7 /* SDDownloadManager.swift */, 160 | 21053D6522088693006AFFB7 /* SDDownloadObject.swift */, 161 | 21053D6622088693006AFFB7 /* SDFileUtils.swift */, 162 | ); 163 | path = SDDownloadManager; 164 | sourceTree = ""; 165 | }; 166 | 21053D5722088664006AFFB7 /* SYWaveformPlayer */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | 21053D5B2208868A006AFFB7 /* pausebutton.png */, 170 | 21053D5C2208868A006AFFB7 /* playbutton.png */, 171 | 21053D602208868A006AFFB7 /* SCWaveformView.h */, 172 | 21053D5D2208868A006AFFB7 /* SCWaveformView.m */, 173 | 21053D5F2208868A006AFFB7 /* SYWaveformPlayerView.h */, 174 | 21053D5E2208868A006AFFB7 /* SYWaveformPlayerView.m */, 175 | ); 176 | path = SYWaveformPlayer; 177 | sourceTree = ""; 178 | }; 179 | /* End PBXGroup section */ 180 | 181 | /* Begin PBXNativeTarget section */ 182 | 21053D2322088635006AFFB7 /* AudioWaveForm */ = { 183 | isa = PBXNativeTarget; 184 | buildConfigurationList = 21053D4C22088637006AFFB7 /* Build configuration list for PBXNativeTarget "AudioWaveForm" */; 185 | buildPhases = ( 186 | 21053D2022088635006AFFB7 /* Sources */, 187 | 21053D2122088635006AFFB7 /* Frameworks */, 188 | 21053D2222088635006AFFB7 /* Resources */, 189 | ); 190 | buildRules = ( 191 | ); 192 | dependencies = ( 193 | ); 194 | name = AudioWaveForm; 195 | productName = AudioWaveForm; 196 | productReference = 21053D2422088635006AFFB7 /* AudioWaveForm.app */; 197 | productType = "com.apple.product-type.application"; 198 | }; 199 | 21053D3722088637006AFFB7 /* AudioWaveFormTests */ = { 200 | isa = PBXNativeTarget; 201 | buildConfigurationList = 21053D4F22088637006AFFB7 /* Build configuration list for PBXNativeTarget "AudioWaveFormTests" */; 202 | buildPhases = ( 203 | 21053D3422088637006AFFB7 /* Sources */, 204 | 21053D3522088637006AFFB7 /* Frameworks */, 205 | 21053D3622088637006AFFB7 /* Resources */, 206 | ); 207 | buildRules = ( 208 | ); 209 | dependencies = ( 210 | 21053D3A22088637006AFFB7 /* PBXTargetDependency */, 211 | ); 212 | name = AudioWaveFormTests; 213 | productName = AudioWaveFormTests; 214 | productReference = 21053D3822088637006AFFB7 /* AudioWaveFormTests.xctest */; 215 | productType = "com.apple.product-type.bundle.unit-test"; 216 | }; 217 | 21053D4222088637006AFFB7 /* AudioWaveFormUITests */ = { 218 | isa = PBXNativeTarget; 219 | buildConfigurationList = 21053D5222088637006AFFB7 /* Build configuration list for PBXNativeTarget "AudioWaveFormUITests" */; 220 | buildPhases = ( 221 | 21053D3F22088637006AFFB7 /* Sources */, 222 | 21053D4022088637006AFFB7 /* Frameworks */, 223 | 21053D4122088637006AFFB7 /* Resources */, 224 | ); 225 | buildRules = ( 226 | ); 227 | dependencies = ( 228 | 21053D4522088637006AFFB7 /* PBXTargetDependency */, 229 | ); 230 | name = AudioWaveFormUITests; 231 | productName = AudioWaveFormUITests; 232 | productReference = 21053D4322088637006AFFB7 /* AudioWaveFormUITests.xctest */; 233 | productType = "com.apple.product-type.bundle.ui-testing"; 234 | }; 235 | /* End PBXNativeTarget section */ 236 | 237 | /* Begin PBXProject section */ 238 | 21053D1C22088635006AFFB7 /* Project object */ = { 239 | isa = PBXProject; 240 | attributes = { 241 | LastSwiftUpdateCheck = 1010; 242 | LastUpgradeCheck = 1010; 243 | ORGANIZATIONNAME = AK_Creation; 244 | TargetAttributes = { 245 | 21053D2322088635006AFFB7 = { 246 | CreatedOnToolsVersion = 10.1; 247 | LastSwiftMigration = 1010; 248 | }; 249 | 21053D3722088637006AFFB7 = { 250 | CreatedOnToolsVersion = 10.1; 251 | TestTargetID = 21053D2322088635006AFFB7; 252 | }; 253 | 21053D4222088637006AFFB7 = { 254 | CreatedOnToolsVersion = 10.1; 255 | TestTargetID = 21053D2322088635006AFFB7; 256 | }; 257 | }; 258 | }; 259 | buildConfigurationList = 21053D1F22088635006AFFB7 /* Build configuration list for PBXProject "AudioWaveForm" */; 260 | compatibilityVersion = "Xcode 9.3"; 261 | developmentRegion = en; 262 | hasScannedForEncodings = 0; 263 | knownRegions = ( 264 | en, 265 | Base, 266 | ); 267 | mainGroup = 21053D1B22088635006AFFB7; 268 | productRefGroup = 21053D2522088635006AFFB7 /* Products */; 269 | projectDirPath = ""; 270 | projectRoot = ""; 271 | targets = ( 272 | 21053D2322088635006AFFB7 /* AudioWaveForm */, 273 | 21053D3722088637006AFFB7 /* AudioWaveFormTests */, 274 | 21053D4222088637006AFFB7 /* AudioWaveFormUITests */, 275 | ); 276 | }; 277 | /* End PBXProject section */ 278 | 279 | /* Begin PBXResourcesBuildPhase section */ 280 | 21053D2222088635006AFFB7 /* Resources */ = { 281 | isa = PBXResourcesBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | 21053D612208868A006AFFB7 /* pausebutton.png in Resources */, 285 | 21053D622208868A006AFFB7 /* playbutton.png in Resources */, 286 | 21053D3222088637006AFFB7 /* LaunchScreen.storyboard in Resources */, 287 | 21053D2F22088637006AFFB7 /* Assets.xcassets in Resources */, 288 | 21053D2D22088635006AFFB7 /* Main.storyboard in Resources */, 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | 21053D3622088637006AFFB7 /* Resources */ = { 293 | isa = PBXResourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | ); 297 | runOnlyForDeploymentPostprocessing = 0; 298 | }; 299 | 21053D4122088637006AFFB7 /* Resources */ = { 300 | isa = PBXResourcesBuildPhase; 301 | buildActionMask = 2147483647; 302 | files = ( 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | }; 306 | /* End PBXResourcesBuildPhase section */ 307 | 308 | /* Begin PBXSourcesBuildPhase section */ 309 | 21053D2022088635006AFFB7 /* Sources */ = { 310 | isa = PBXSourcesBuildPhase; 311 | buildActionMask = 2147483647; 312 | files = ( 313 | 21053D642208868A006AFFB7 /* SYWaveformPlayerView.m in Sources */, 314 | 21053D632208868A006AFFB7 /* SCWaveformView.m in Sources */, 315 | 21053D6922088693006AFFB7 /* SDFileUtils.swift in Sources */, 316 | 21053D6822088693006AFFB7 /* SDDownloadObject.swift in Sources */, 317 | 21053D2A22088635006AFFB7 /* ViewController.swift in Sources */, 318 | 21053D2822088635006AFFB7 /* AppDelegate.swift in Sources */, 319 | 21053D6A22088693006AFFB7 /* SDDownloadManager.swift in Sources */, 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | }; 323 | 21053D3422088637006AFFB7 /* Sources */ = { 324 | isa = PBXSourcesBuildPhase; 325 | buildActionMask = 2147483647; 326 | files = ( 327 | 21053D3D22088637006AFFB7 /* AudioWaveFormTests.swift in Sources */, 328 | ); 329 | runOnlyForDeploymentPostprocessing = 0; 330 | }; 331 | 21053D3F22088637006AFFB7 /* Sources */ = { 332 | isa = PBXSourcesBuildPhase; 333 | buildActionMask = 2147483647; 334 | files = ( 335 | 21053D4822088637006AFFB7 /* AudioWaveFormUITests.swift in Sources */, 336 | ); 337 | runOnlyForDeploymentPostprocessing = 0; 338 | }; 339 | /* End PBXSourcesBuildPhase section */ 340 | 341 | /* Begin PBXTargetDependency section */ 342 | 21053D3A22088637006AFFB7 /* PBXTargetDependency */ = { 343 | isa = PBXTargetDependency; 344 | target = 21053D2322088635006AFFB7 /* AudioWaveForm */; 345 | targetProxy = 21053D3922088637006AFFB7 /* PBXContainerItemProxy */; 346 | }; 347 | 21053D4522088637006AFFB7 /* PBXTargetDependency */ = { 348 | isa = PBXTargetDependency; 349 | target = 21053D2322088635006AFFB7 /* AudioWaveForm */; 350 | targetProxy = 21053D4422088637006AFFB7 /* PBXContainerItemProxy */; 351 | }; 352 | /* End PBXTargetDependency section */ 353 | 354 | /* Begin PBXVariantGroup section */ 355 | 21053D2B22088635006AFFB7 /* Main.storyboard */ = { 356 | isa = PBXVariantGroup; 357 | children = ( 358 | 21053D2C22088635006AFFB7 /* Base */, 359 | ); 360 | name = Main.storyboard; 361 | sourceTree = ""; 362 | }; 363 | 21053D3022088637006AFFB7 /* LaunchScreen.storyboard */ = { 364 | isa = PBXVariantGroup; 365 | children = ( 366 | 21053D3122088637006AFFB7 /* Base */, 367 | ); 368 | name = LaunchScreen.storyboard; 369 | sourceTree = ""; 370 | }; 371 | /* End PBXVariantGroup section */ 372 | 373 | /* Begin XCBuildConfiguration section */ 374 | 21053D4A22088637006AFFB7 /* Debug */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | ALWAYS_SEARCH_USER_PATHS = NO; 378 | CLANG_ANALYZER_NONNULL = YES; 379 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 380 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 381 | CLANG_CXX_LIBRARY = "libc++"; 382 | CLANG_ENABLE_MODULES = YES; 383 | CLANG_ENABLE_OBJC_ARC = YES; 384 | CLANG_ENABLE_OBJC_WEAK = YES; 385 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 386 | CLANG_WARN_BOOL_CONVERSION = YES; 387 | CLANG_WARN_COMMA = YES; 388 | CLANG_WARN_CONSTANT_CONVERSION = YES; 389 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 390 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 391 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 392 | CLANG_WARN_EMPTY_BODY = YES; 393 | CLANG_WARN_ENUM_CONVERSION = YES; 394 | CLANG_WARN_INFINITE_RECURSION = YES; 395 | CLANG_WARN_INT_CONVERSION = YES; 396 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 397 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 398 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 399 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 400 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 401 | CLANG_WARN_STRICT_PROTOTYPES = YES; 402 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 403 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 404 | CLANG_WARN_UNREACHABLE_CODE = YES; 405 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 406 | CODE_SIGN_IDENTITY = "iPhone Developer"; 407 | COPY_PHASE_STRIP = NO; 408 | DEBUG_INFORMATION_FORMAT = dwarf; 409 | ENABLE_STRICT_OBJC_MSGSEND = YES; 410 | ENABLE_TESTABILITY = YES; 411 | GCC_C_LANGUAGE_STANDARD = gnu11; 412 | GCC_DYNAMIC_NO_PIC = NO; 413 | GCC_NO_COMMON_BLOCKS = YES; 414 | GCC_OPTIMIZATION_LEVEL = 0; 415 | GCC_PREPROCESSOR_DEFINITIONS = ( 416 | "DEBUG=1", 417 | "$(inherited)", 418 | ); 419 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 420 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 421 | GCC_WARN_UNDECLARED_SELECTOR = YES; 422 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 423 | GCC_WARN_UNUSED_FUNCTION = YES; 424 | GCC_WARN_UNUSED_VARIABLE = YES; 425 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 426 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 427 | MTL_FAST_MATH = YES; 428 | ONLY_ACTIVE_ARCH = YES; 429 | SDKROOT = iphoneos; 430 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 431 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 432 | }; 433 | name = Debug; 434 | }; 435 | 21053D4B22088637006AFFB7 /* Release */ = { 436 | isa = XCBuildConfiguration; 437 | buildSettings = { 438 | ALWAYS_SEARCH_USER_PATHS = NO; 439 | CLANG_ANALYZER_NONNULL = YES; 440 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 441 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 442 | CLANG_CXX_LIBRARY = "libc++"; 443 | CLANG_ENABLE_MODULES = YES; 444 | CLANG_ENABLE_OBJC_ARC = YES; 445 | CLANG_ENABLE_OBJC_WEAK = YES; 446 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 447 | CLANG_WARN_BOOL_CONVERSION = YES; 448 | CLANG_WARN_COMMA = YES; 449 | CLANG_WARN_CONSTANT_CONVERSION = YES; 450 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 451 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 452 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 453 | CLANG_WARN_EMPTY_BODY = YES; 454 | CLANG_WARN_ENUM_CONVERSION = YES; 455 | CLANG_WARN_INFINITE_RECURSION = YES; 456 | CLANG_WARN_INT_CONVERSION = YES; 457 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 458 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 459 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 460 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 461 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 462 | CLANG_WARN_STRICT_PROTOTYPES = YES; 463 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 464 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 465 | CLANG_WARN_UNREACHABLE_CODE = YES; 466 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 467 | CODE_SIGN_IDENTITY = "iPhone Developer"; 468 | COPY_PHASE_STRIP = NO; 469 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 470 | ENABLE_NS_ASSERTIONS = NO; 471 | ENABLE_STRICT_OBJC_MSGSEND = YES; 472 | GCC_C_LANGUAGE_STANDARD = gnu11; 473 | GCC_NO_COMMON_BLOCKS = YES; 474 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 475 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 476 | GCC_WARN_UNDECLARED_SELECTOR = YES; 477 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 478 | GCC_WARN_UNUSED_FUNCTION = YES; 479 | GCC_WARN_UNUSED_VARIABLE = YES; 480 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 481 | MTL_ENABLE_DEBUG_INFO = NO; 482 | MTL_FAST_MATH = YES; 483 | SDKROOT = iphoneos; 484 | SWIFT_COMPILATION_MODE = wholemodule; 485 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 486 | VALIDATE_PRODUCT = YES; 487 | }; 488 | name = Release; 489 | }; 490 | 21053D4D22088637006AFFB7 /* Debug */ = { 491 | isa = XCBuildConfiguration; 492 | buildSettings = { 493 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 494 | CLANG_ENABLE_MODULES = YES; 495 | CODE_SIGN_STYLE = Automatic; 496 | INFOPLIST_FILE = AudioWaveForm/Info.plist; 497 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 498 | LD_RUNPATH_SEARCH_PATHS = ( 499 | "$(inherited)", 500 | "@executable_path/Frameworks", 501 | ); 502 | PRODUCT_BUNDLE_IDENTIFIER = "com.AK-Creation.AudioWaveForm"; 503 | PRODUCT_NAME = "$(TARGET_NAME)"; 504 | SWIFT_OBJC_BRIDGING_HEADER = "AudioWaveForm/AudioWaveForm-Bridging-Header.h"; 505 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 506 | SWIFT_VERSION = 4.2; 507 | TARGETED_DEVICE_FAMILY = "1,2"; 508 | }; 509 | name = Debug; 510 | }; 511 | 21053D4E22088637006AFFB7 /* Release */ = { 512 | isa = XCBuildConfiguration; 513 | buildSettings = { 514 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 515 | CLANG_ENABLE_MODULES = YES; 516 | CODE_SIGN_STYLE = Automatic; 517 | INFOPLIST_FILE = AudioWaveForm/Info.plist; 518 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 519 | LD_RUNPATH_SEARCH_PATHS = ( 520 | "$(inherited)", 521 | "@executable_path/Frameworks", 522 | ); 523 | PRODUCT_BUNDLE_IDENTIFIER = "com.AK-Creation.AudioWaveForm"; 524 | PRODUCT_NAME = "$(TARGET_NAME)"; 525 | SWIFT_OBJC_BRIDGING_HEADER = "AudioWaveForm/AudioWaveForm-Bridging-Header.h"; 526 | SWIFT_VERSION = 4.2; 527 | TARGETED_DEVICE_FAMILY = "1,2"; 528 | }; 529 | name = Release; 530 | }; 531 | 21053D5022088637006AFFB7 /* Debug */ = { 532 | isa = XCBuildConfiguration; 533 | buildSettings = { 534 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 535 | BUNDLE_LOADER = "$(TEST_HOST)"; 536 | CODE_SIGN_STYLE = Automatic; 537 | INFOPLIST_FILE = AudioWaveFormTests/Info.plist; 538 | LD_RUNPATH_SEARCH_PATHS = ( 539 | "$(inherited)", 540 | "@executable_path/Frameworks", 541 | "@loader_path/Frameworks", 542 | ); 543 | PRODUCT_BUNDLE_IDENTIFIER = "com.AK-Creation.AudioWaveFormTests"; 544 | PRODUCT_NAME = "$(TARGET_NAME)"; 545 | SWIFT_VERSION = 4.2; 546 | TARGETED_DEVICE_FAMILY = "1,2"; 547 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AudioWaveForm.app/AudioWaveForm"; 548 | }; 549 | name = Debug; 550 | }; 551 | 21053D5122088637006AFFB7 /* Release */ = { 552 | isa = XCBuildConfiguration; 553 | buildSettings = { 554 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 555 | BUNDLE_LOADER = "$(TEST_HOST)"; 556 | CODE_SIGN_STYLE = Automatic; 557 | INFOPLIST_FILE = AudioWaveFormTests/Info.plist; 558 | LD_RUNPATH_SEARCH_PATHS = ( 559 | "$(inherited)", 560 | "@executable_path/Frameworks", 561 | "@loader_path/Frameworks", 562 | ); 563 | PRODUCT_BUNDLE_IDENTIFIER = "com.AK-Creation.AudioWaveFormTests"; 564 | PRODUCT_NAME = "$(TARGET_NAME)"; 565 | SWIFT_VERSION = 4.2; 566 | TARGETED_DEVICE_FAMILY = "1,2"; 567 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AudioWaveForm.app/AudioWaveForm"; 568 | }; 569 | name = Release; 570 | }; 571 | 21053D5322088637006AFFB7 /* Debug */ = { 572 | isa = XCBuildConfiguration; 573 | buildSettings = { 574 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 575 | CODE_SIGN_STYLE = Automatic; 576 | INFOPLIST_FILE = AudioWaveFormUITests/Info.plist; 577 | LD_RUNPATH_SEARCH_PATHS = ( 578 | "$(inherited)", 579 | "@executable_path/Frameworks", 580 | "@loader_path/Frameworks", 581 | ); 582 | PRODUCT_BUNDLE_IDENTIFIER = "com.AK-Creation.AudioWaveFormUITests"; 583 | PRODUCT_NAME = "$(TARGET_NAME)"; 584 | SWIFT_VERSION = 4.2; 585 | TARGETED_DEVICE_FAMILY = "1,2"; 586 | TEST_TARGET_NAME = AudioWaveForm; 587 | }; 588 | name = Debug; 589 | }; 590 | 21053D5422088637006AFFB7 /* Release */ = { 591 | isa = XCBuildConfiguration; 592 | buildSettings = { 593 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 594 | CODE_SIGN_STYLE = Automatic; 595 | INFOPLIST_FILE = AudioWaveFormUITests/Info.plist; 596 | LD_RUNPATH_SEARCH_PATHS = ( 597 | "$(inherited)", 598 | "@executable_path/Frameworks", 599 | "@loader_path/Frameworks", 600 | ); 601 | PRODUCT_BUNDLE_IDENTIFIER = "com.AK-Creation.AudioWaveFormUITests"; 602 | PRODUCT_NAME = "$(TARGET_NAME)"; 603 | SWIFT_VERSION = 4.2; 604 | TARGETED_DEVICE_FAMILY = "1,2"; 605 | TEST_TARGET_NAME = AudioWaveForm; 606 | }; 607 | name = Release; 608 | }; 609 | /* End XCBuildConfiguration section */ 610 | 611 | /* Begin XCConfigurationList section */ 612 | 21053D1F22088635006AFFB7 /* Build configuration list for PBXProject "AudioWaveForm" */ = { 613 | isa = XCConfigurationList; 614 | buildConfigurations = ( 615 | 21053D4A22088637006AFFB7 /* Debug */, 616 | 21053D4B22088637006AFFB7 /* Release */, 617 | ); 618 | defaultConfigurationIsVisible = 0; 619 | defaultConfigurationName = Release; 620 | }; 621 | 21053D4C22088637006AFFB7 /* Build configuration list for PBXNativeTarget "AudioWaveForm" */ = { 622 | isa = XCConfigurationList; 623 | buildConfigurations = ( 624 | 21053D4D22088637006AFFB7 /* Debug */, 625 | 21053D4E22088637006AFFB7 /* Release */, 626 | ); 627 | defaultConfigurationIsVisible = 0; 628 | defaultConfigurationName = Release; 629 | }; 630 | 21053D4F22088637006AFFB7 /* Build configuration list for PBXNativeTarget "AudioWaveFormTests" */ = { 631 | isa = XCConfigurationList; 632 | buildConfigurations = ( 633 | 21053D5022088637006AFFB7 /* Debug */, 634 | 21053D5122088637006AFFB7 /* Release */, 635 | ); 636 | defaultConfigurationIsVisible = 0; 637 | defaultConfigurationName = Release; 638 | }; 639 | 21053D5222088637006AFFB7 /* Build configuration list for PBXNativeTarget "AudioWaveFormUITests" */ = { 640 | isa = XCConfigurationList; 641 | buildConfigurations = ( 642 | 21053D5322088637006AFFB7 /* Debug */, 643 | 21053D5422088637006AFFB7 /* Release */, 644 | ); 645 | defaultConfigurationIsVisible = 0; 646 | defaultConfigurationName = Release; 647 | }; 648 | /* End XCConfigurationList section */ 649 | }; 650 | rootObject = 21053D1C22088635006AFFB7 /* Project object */; 651 | } 652 | -------------------------------------------------------------------------------- /AudioWaveForm.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AudioWaveForm.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AudioWaveForm/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // AudioWaveForm 4 | // 5 | // Created by PIYUSH GHOGHARI on 04/02/19. 6 | // Copyright © 2019 AK_Creation. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | func applicationWillResignActive(_ application: UIApplication) { 22 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 23 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 24 | } 25 | 26 | func applicationDidEnterBackground(_ application: UIApplication) { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | func applicationWillEnterForeground(_ application: UIApplication) { 32 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 33 | } 34 | 35 | func applicationDidBecomeActive(_ application: UIApplication) { 36 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 37 | } 38 | 39 | func applicationWillTerminate(_ application: UIApplication) { 40 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 41 | } 42 | 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /AudioWaveForm/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /AudioWaveForm/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /AudioWaveForm/Assets.xcassets/ic_Close.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_Close.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /AudioWaveForm/Assets.xcassets/ic_Close.imageset/ic_Close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piyushghoghari08/AKWaveform/aead7593cdaffce44a1d8a7b476a830f5e5f3a34/AudioWaveForm/Assets.xcassets/ic_Close.imageset/ic_Close.png -------------------------------------------------------------------------------- /AudioWaveForm/Assets.xcassets/ic_Music_Download.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_Music_Download.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /AudioWaveForm/Assets.xcassets/ic_Music_Download.imageset/ic_Music_Download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piyushghoghari08/AKWaveform/aead7593cdaffce44a1d8a7b476a830f5e5f3a34/AudioWaveForm/Assets.xcassets/ic_Music_Download.imageset/ic_Music_Download.png -------------------------------------------------------------------------------- /AudioWaveForm/Assets.xcassets/waveform.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "waveform.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /AudioWaveForm/Assets.xcassets/waveform.imageset/waveform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piyushghoghari08/AKWaveform/aead7593cdaffce44a1d8a7b476a830f5e5f3a34/AudioWaveForm/Assets.xcassets/waveform.imageset/waveform.png -------------------------------------------------------------------------------- /AudioWaveForm/AudioWaveForm-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "SYWaveformPlayerView.h" 6 | -------------------------------------------------------------------------------- /AudioWaveForm/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /AudioWaveForm/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /AudioWaveForm/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Waveform 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | LSSupportsOpeningDocumentsInPlace 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | 32 | UIFileSharingEnabled 33 | 34 | UILaunchStoryboardName 35 | LaunchScreen 36 | UIMainStoryboardFile 37 | Main 38 | UIRequiredDeviceCapabilities 39 | 40 | armv7 41 | 42 | UISupportedInterfaceOrientations 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | UISupportedInterfaceOrientations~ipad 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationPortraitUpsideDown 52 | UIInterfaceOrientationLandscapeLeft 53 | UIInterfaceOrientationLandscapeRight 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /AudioWaveForm/Resources/SDDownloadManager/SDDownloadManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SDDownloadManager.swift 3 | // SDDownloadManager 4 | // 5 | // Created by Sagar Dagdu on 8/4/17. 6 | // Copyright © 2017 Sagar Dagdu. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | import UIKit 27 | 28 | final public class SDDownloadManager: NSObject { 29 | 30 | public typealias DownloadCompletionBlock = (_ error : Error?, _ fileUrl:URL?) -> Void 31 | public typealias DownloadProgressBlock = (_ progress : CGFloat) -> Void 32 | 33 | // MARK :- Properties 34 | 35 | var session: URLSession = URLSession() 36 | var ongoingDownloads: [String : SDDownloadObject] = [:] 37 | 38 | public static let shared: SDDownloadManager = { return SDDownloadManager() }() 39 | 40 | //MARK:- Public methods 41 | 42 | public func dowloadFile(withRequest request: URLRequest, 43 | inDirectory directory: String? = nil, 44 | withName fileName: String? = nil, 45 | onProgress progressBlock:DownloadProgressBlock? = nil, 46 | onCompletion completionBlock:@escaping DownloadCompletionBlock) -> String? { 47 | 48 | if let _ = self.ongoingDownloads[(request.url?.absoluteString)!] { 49 | print("Already in progress") 50 | return nil 51 | } 52 | 53 | let downloadTask = self.session.downloadTask(with: request) 54 | let download = SDDownloadObject(downloadTask: downloadTask, 55 | progressBlock: progressBlock, 56 | completionBlock: completionBlock, 57 | fileName: fileName, 58 | directoryName: directory) 59 | 60 | let key = (request.url?.absoluteString)! 61 | self.ongoingDownloads[key] = download 62 | downloadTask.resume() 63 | return key; 64 | } 65 | 66 | public func currentDownloads() -> [String] { 67 | return Array(self.ongoingDownloads.keys) 68 | } 69 | 70 | public func cancelAllDownloads() { 71 | for (_, download) in self.ongoingDownloads { 72 | let downloadTask = download.downloadTask 73 | downloadTask.cancel() 74 | } 75 | self.ongoingDownloads.removeAll() 76 | } 77 | 78 | public func cancelDownload(forUniqueKey key:String?) { 79 | let downloadStatus = self.isDownloadInProgress(forUniqueKey: key) 80 | let presence = downloadStatus.0 81 | if presence { 82 | if let download = downloadStatus.1 { 83 | download.downloadTask.cancel() 84 | self.ongoingDownloads.removeValue(forKey: key!) 85 | } 86 | } 87 | } 88 | 89 | public func isDownloadInProgress(forKey key:String?) -> Bool { 90 | let downloadStatus = self.isDownloadInProgress(forUniqueKey: key) 91 | return downloadStatus.0 92 | } 93 | 94 | public func alterBlocksForOngoingDownload(withUniqueKey key:String?, 95 | setProgress progressBlock:DownloadProgressBlock?, 96 | setCompletion completionBlock:@escaping DownloadCompletionBlock) { 97 | let downloadStatus = self.isDownloadInProgress(forUniqueKey: key) 98 | let presence = downloadStatus.0 99 | if presence { 100 | if let download = downloadStatus.1 { 101 | download.progressBlock = progressBlock 102 | download.completionBlock = completionBlock 103 | } 104 | } 105 | } 106 | //MARK:- Private methods 107 | 108 | private override init() { 109 | super.init() 110 | let sessionConfiguration = URLSessionConfiguration.default 111 | self.session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue: nil) 112 | } 113 | 114 | private func isDownloadInProgress(forUniqueKey key:String?) -> (Bool, SDDownloadObject?) { 115 | guard let key = key else { return (false, nil) } 116 | for (uniqueKey, download) in self.ongoingDownloads { 117 | if key == uniqueKey { 118 | return (true, download) 119 | } 120 | } 121 | return (false, nil) 122 | } 123 | 124 | } 125 | 126 | extension SDDownloadManager : URLSessionDelegate, URLSessionDownloadDelegate { 127 | 128 | // MARK:- Delegates 129 | 130 | public func urlSession(_ session: URLSession, 131 | downloadTask: URLSessionDownloadTask, 132 | didFinishDownloadingTo location: URL) { 133 | 134 | let key = (downloadTask.originalRequest?.url?.absoluteString)! 135 | if let download = self.ongoingDownloads[key] { 136 | if let response = downloadTask.response { 137 | let statusCode = (response as! HTTPURLResponse).statusCode 138 | 139 | guard statusCode < 400 else { 140 | let error = NSError(domain:"HttpError", code:statusCode, userInfo:[NSLocalizedDescriptionKey : HTTPURLResponse.localizedString(forStatusCode: statusCode)]) 141 | OperationQueue.main.addOperation({ 142 | download.completionBlock(error,nil) 143 | }) 144 | return 145 | } 146 | let fileName = download.fileName ?? downloadTask.response?.suggestedFilename ?? (downloadTask.originalRequest?.url?.lastPathComponent)! 147 | let directoryName = download.directoryName 148 | 149 | let fileMovingResult = SDFileUtils.moveFile(fromUrl: location, toDirectory: directoryName, withName: fileName) 150 | let didSucceed = fileMovingResult.0 151 | let error = fileMovingResult.1 152 | let finalFileUrl = fileMovingResult.2 153 | 154 | OperationQueue.main.addOperation({ 155 | (didSucceed ? download.completionBlock(nil,finalFileUrl) : download.completionBlock(error,nil)) 156 | }) 157 | } 158 | } 159 | self.ongoingDownloads.removeValue(forKey:key) 160 | } 161 | 162 | public func urlSession(_ session: URLSession, 163 | downloadTask: URLSessionDownloadTask, 164 | didWriteData bytesWritten: Int64, 165 | totalBytesWritten: Int64, 166 | totalBytesExpectedToWrite: Int64) { 167 | 168 | if let download = self.ongoingDownloads[(downloadTask.originalRequest?.url?.absoluteString)!], 169 | let progressBlock = download.progressBlock { 170 | let progress : CGFloat = CGFloat(totalBytesWritten) / CGFloat(totalBytesExpectedToWrite) 171 | OperationQueue.main.addOperation({ 172 | progressBlock(progress) 173 | }) 174 | } 175 | } 176 | 177 | public func urlSession(_ session: URLSession, 178 | task: URLSessionTask, 179 | didCompleteWithError error: Error?) { 180 | 181 | if let error = error { 182 | let downloadTask = task as! URLSessionDownloadTask 183 | let key = (downloadTask.originalRequest?.url?.absoluteString)! 184 | if let download = self.ongoingDownloads[key] { 185 | OperationQueue.main.addOperation({ 186 | download.completionBlock(error,nil) 187 | }) 188 | } 189 | self.ongoingDownloads.removeValue(forKey:key) 190 | } 191 | } 192 | 193 | } 194 | -------------------------------------------------------------------------------- /AudioWaveForm/Resources/SDDownloadManager/SDDownloadObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SDDownloadObject.swift 3 | // SDDownloadManager 4 | // 5 | // Created by Sagar Dagdu on 8/4/17. 6 | // Copyright © 2017 Sagar Dagdu. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | import UIKit 28 | 29 | class SDDownloadObject: NSObject { 30 | 31 | var completionBlock: SDDownloadManager.DownloadCompletionBlock 32 | var progressBlock: SDDownloadManager.DownloadProgressBlock? 33 | let downloadTask: URLSessionDownloadTask 34 | let directoryName: String? 35 | let fileName:String? 36 | 37 | init(downloadTask: URLSessionDownloadTask, 38 | progressBlock: SDDownloadManager.DownloadProgressBlock?, 39 | completionBlock: @escaping SDDownloadManager.DownloadCompletionBlock, 40 | fileName: String?, 41 | directoryName: String?) { 42 | 43 | self.downloadTask = downloadTask 44 | self.completionBlock = completionBlock 45 | self.progressBlock = progressBlock 46 | self.fileName = fileName 47 | self.directoryName = directoryName 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /AudioWaveForm/Resources/SDDownloadManager/SDFileUtils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SDFileUtils.swift 3 | // SDDownloadManager 4 | // 5 | // Created by Sagar Dagdu on 8/5/17. 6 | // Copyright © 2017 Sagar Dagdu. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | import UIKit 27 | 28 | class SDFileUtils: NSObject { 29 | 30 | // MARK:- Helpers 31 | 32 | static func moveFile(fromUrl url:URL, 33 | toDirectory directory:String? , 34 | withName name:String) -> (Bool, Error?, URL?) { 35 | 36 | //Custom code for display file into local file manager 37 | let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) 38 | let paths = documentsDirectory[0].appendingPathComponent("DownloadAudio") 39 | let filename = "Audio_\(directory!).m4a" 40 | let filePath = paths.appendingPathComponent(filename) 41 | do{ 42 | try FileManager.default.createDirectory(atPath: paths.path, withIntermediateDirectories: true, attributes: nil) 43 | try FileManager.default.moveItem(at: url, to: filePath) 44 | return (true, nil, filePath) 45 | }catch let error as NSError{ 46 | NSLog("Unable to create directory \(error.debugDescription)") 47 | return (true, nil, filePath) 48 | } } 49 | 50 | static func cacheDirectoryPath() -> URL { 51 | let cachePath = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0] 52 | return URL(fileURLWithPath: cachePath) 53 | } 54 | 55 | static func createDirectoryIfNotExists(withName name:String) -> (Bool, Error?) { 56 | let directoryUrl = self.cacheDirectoryPath().appendingPathComponent(name) 57 | if FileManager.default.fileExists(atPath: directoryUrl.path) { 58 | return (true, nil) 59 | } 60 | do { 61 | try FileManager.default.createDirectory(at: directoryUrl, withIntermediateDirectories: true, attributes: nil) 62 | return (true, nil) 63 | } catch { 64 | return (false, error) 65 | } 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /AudioWaveForm/Resources/SYWaveformPlayer/SCWaveformView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCWaveformView.h 3 | // SCWaveformView 4 | // 5 | // Created by Simon CORSIN on 24/01/14. 6 | // Copyright (c) 2014 Simon CORSIN. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | @interface SCWaveformView : UIView 14 | 15 | @property (strong, readwrite, nonatomic) AVAsset *asset; 16 | @property (strong, readwrite, nonatomic) UIColor *normalColor; 17 | @property (strong, readwrite, nonatomic) UIColor *progressColor; 18 | @property (assign, readwrite, nonatomic) CGFloat progress; 19 | @property (assign, readwrite, nonatomic) BOOL antialiasingEnabled; 20 | 21 | @property (readwrite, nonatomic) UIImage *generatedNormalImage; 22 | @property (readwrite, nonatomic) UIImage *generatedProgressImage; 23 | 24 | // Ask the waveformview to generate the waveform right now 25 | // instead of doing it in the next draw operation 26 | - (void)generateWaveforms; 27 | 28 | // Render the waveform on a specified context 29 | + (void)renderWaveformInContext:(CGContextRef)context asset:(AVAsset *)asset withColor:(UIColor *)color andSize:(CGSize)size antialiasingEnabled:(BOOL)antialiasingEnabled; 30 | 31 | // Generate a waveform image for an asset 32 | + (UIImage*)generateWaveformImage:(AVAsset*)asset withColor:(UIColor*)color andSize:(CGSize)size antialiasingEnabled:(BOOL)antialiasingEnabled; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /AudioWaveForm/Resources/SYWaveformPlayer/SCWaveformView.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCWaveformView.m 3 | // SCWaveformView 4 | // 5 | // Created by Simon CORSIN on 24/01/14. 6 | // Copyright (c) 2014 Simon CORSIN. All rights reserved. 7 | // 8 | 9 | #import "SCWaveformView.h" 10 | 11 | #define absX(x) (x < 0 ? 0 - x : x) 12 | #define minMaxX(x, mn, mx) (x <= mn ? mn : (x >= mx ? mx : x)) 13 | #define noiseFloor (-50.0) 14 | #define decibel(amplitude) (20.0 * log10(absX(amplitude) / 32767.0)) 15 | 16 | @interface SCWaveformView() { 17 | UIImageView *_normalImageView; 18 | UIImageView *_progressImageView; 19 | UIView *_cropNormalView; 20 | UIView *_cropProgressView; 21 | BOOL _normalColorDirty; 22 | BOOL _progressColorDirty; 23 | } 24 | 25 | @end 26 | 27 | @implementation SCWaveformView 28 | 29 | - (instancetype)init { 30 | self = [super init]; 31 | 32 | if (self) { 33 | [self commonInit]; 34 | } 35 | 36 | return self; 37 | } 38 | 39 | - (instancetype)initWithCoder:(NSCoder *)aDecoder 40 | { 41 | self = [super initWithCoder:aDecoder]; 42 | 43 | if (self) { 44 | [self commonInit]; 45 | } 46 | 47 | return self; 48 | } 49 | 50 | - (void)commonInit 51 | { 52 | _normalImageView = [[UIImageView alloc] init]; 53 | _progressImageView = [[UIImageView alloc] init]; 54 | _cropNormalView = [[UIView alloc] init]; 55 | _cropProgressView = [[UIView alloc] init]; 56 | 57 | _cropNormalView.clipsToBounds = YES; 58 | _cropProgressView.clipsToBounds = YES; 59 | 60 | [_cropNormalView addSubview:_normalImageView]; 61 | [_cropProgressView addSubview:_progressImageView]; 62 | 63 | [self addSubview:_cropNormalView]; 64 | [self addSubview:_cropProgressView]; 65 | 66 | self.normalColor = [UIColor blueColor]; 67 | self.progressColor = [UIColor redColor]; 68 | 69 | _normalColorDirty = NO; 70 | _progressColorDirty = NO; 71 | } 72 | 73 | void SCRenderPixelWaveformInContext(CGContextRef context, float halfGraphHeight, double sample, float x) 74 | { 75 | float pixelHeight = halfGraphHeight * (1 - sample / noiseFloor); 76 | 77 | if (pixelHeight < 0) { 78 | pixelHeight = 0; 79 | } 80 | 81 | CGContextMoveToPoint(context, x, halfGraphHeight - pixelHeight); 82 | CGContextAddLineToPoint(context, x, halfGraphHeight + pixelHeight); 83 | CGContextStrokePath(context); 84 | 85 | } 86 | 87 | + (void)renderWaveformInContext:(CGContextRef)context asset:(AVAsset *)asset withColor:(UIColor *)color andSize:(CGSize)size antialiasingEnabled:(BOOL)antialiasingEnabled 88 | { 89 | if (asset == nil) { 90 | return; 91 | } 92 | 93 | CGFloat pixelRatio = [UIScreen mainScreen].scale; 94 | size.width *= pixelRatio; 95 | size.height *= pixelRatio; 96 | 97 | CGFloat widthInPixels = size.width; 98 | CGFloat heightInPixels = size.height; 99 | 100 | NSError *error = nil; 101 | AVAssetReader *reader = [[AVAssetReader alloc] initWithAsset:asset error:&error]; 102 | 103 | NSArray *audioTrackArray = [asset tracksWithMediaType:AVMediaTypeAudio]; 104 | 105 | if (audioTrackArray.count == 0) { 106 | return; 107 | } 108 | 109 | AVAssetTrack *songTrack = [audioTrackArray objectAtIndex:0]; 110 | 111 | NSDictionary *outputSettingsDict = [[NSDictionary alloc] initWithObjectsAndKeys: 112 | [NSNumber numberWithInt:kAudioFormatLinearPCM], AVFormatIDKey, 113 | [NSNumber numberWithInt:16], AVLinearPCMBitDepthKey, 114 | [NSNumber numberWithBool:NO], AVLinearPCMIsBigEndianKey, 115 | [NSNumber numberWithBool:NO], AVLinearPCMIsFloatKey, 116 | [NSNumber numberWithBool:NO], AVLinearPCMIsNonInterleaved, 117 | nil]; 118 | AVAssetReaderTrackOutput *output = [[AVAssetReaderTrackOutput alloc] initWithTrack:songTrack outputSettings:outputSettingsDict]; 119 | [reader addOutput:output]; 120 | 121 | UInt32 channelCount; 122 | NSArray *formatDesc = songTrack.formatDescriptions; 123 | for (unsigned int i = 0; i < [formatDesc count]; ++i) { 124 | CMAudioFormatDescriptionRef item = (__bridge CMAudioFormatDescriptionRef)[formatDesc objectAtIndex:i]; 125 | const AudioStreamBasicDescription* fmtDesc = CMAudioFormatDescriptionGetStreamBasicDescription(item); 126 | 127 | if (fmtDesc == nil) { 128 | return; 129 | } 130 | 131 | channelCount = fmtDesc->mChannelsPerFrame; 132 | } 133 | 134 | CGContextSetAllowsAntialiasing(context, antialiasingEnabled); 135 | CGContextSetLineWidth(context, 1.0); 136 | CGContextSetStrokeColorWithColor(context, color.CGColor); 137 | CGContextSetFillColorWithColor(context, color.CGColor); 138 | 139 | UInt32 bytesPerInputSample = 2 * channelCount; 140 | unsigned long int totalSamples = (unsigned long int)asset.duration.value; 141 | NSUInteger samplesPerPixel = totalSamples / (widthInPixels); 142 | samplesPerPixel = samplesPerPixel < 1 ? 1 : samplesPerPixel; 143 | [reader startReading]; 144 | 145 | float halfGraphHeight = (heightInPixels / 2); 146 | double bigSample = 0; 147 | NSUInteger bigSampleCount = 0; 148 | NSMutableData * data = [NSMutableData dataWithLength:32768]; 149 | 150 | CGFloat currentX = 0; 151 | while (reader.status == AVAssetReaderStatusReading) { 152 | CMSampleBufferRef sampleBufferRef = [output copyNextSampleBuffer]; 153 | 154 | if (sampleBufferRef) { 155 | CMBlockBufferRef blockBufferRef = CMSampleBufferGetDataBuffer(sampleBufferRef); 156 | size_t bufferLength = CMBlockBufferGetDataLength(blockBufferRef); 157 | 158 | if (data.length < bufferLength) { 159 | [data setLength:bufferLength]; 160 | } 161 | 162 | CMBlockBufferCopyDataBytes(blockBufferRef, 0, bufferLength, data.mutableBytes); 163 | 164 | SInt16 *samples = (SInt16 *)data.mutableBytes; 165 | int sampleCount = (int)(bufferLength / bytesPerInputSample); 166 | for (int i = 0; i < sampleCount; i++) { 167 | Float32 sample = (Float32) *samples++; 168 | sample = decibel(sample); 169 | sample = minMaxX(sample, noiseFloor, 0); 170 | 171 | for (int j = 1; j < channelCount; j++) 172 | samples++; 173 | 174 | bigSample += sample; 175 | bigSampleCount++; 176 | 177 | if (bigSampleCount == samplesPerPixel) { 178 | double averageSample = bigSample / (double)bigSampleCount; 179 | 180 | SCRenderPixelWaveformInContext(context, halfGraphHeight, averageSample, currentX); 181 | 182 | currentX ++; 183 | bigSample = 0; 184 | bigSampleCount = 0; 185 | } 186 | } 187 | CMSampleBufferInvalidate(sampleBufferRef); 188 | CFRelease(sampleBufferRef); 189 | } 190 | } 191 | 192 | // Rendering the last pixels 193 | bigSample = bigSampleCount > 0 ? bigSample / (double)bigSampleCount : noiseFloor; 194 | while (currentX < size.width) { 195 | SCRenderPixelWaveformInContext(context, halfGraphHeight, bigSample, currentX); 196 | currentX++; 197 | } 198 | 199 | } 200 | 201 | + (UIImage*)generateWaveformImage:(AVAsset *)asset withColor:(UIColor *)color andSize:(CGSize)size antialiasingEnabled:(BOOL)antialiasingEnabled 202 | { 203 | CGFloat ratio = [UIScreen mainScreen].scale; 204 | UIGraphicsBeginImageContextWithOptions(CGSizeMake(size.width * ratio, size.height * ratio), NO, 1); 205 | 206 | [SCWaveformView renderWaveformInContext:UIGraphicsGetCurrentContext() asset:asset withColor:color andSize:size antialiasingEnabled:antialiasingEnabled]; 207 | 208 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 209 | 210 | UIGraphicsEndImageContext(); 211 | 212 | return image; 213 | } 214 | 215 | + (UIImage*)recolorizeImage:(UIImage*)image withColor:(UIColor*)color 216 | { 217 | CGRect imageRect = CGRectMake(0, 0, image.size.width, image.size.height); 218 | UIGraphicsBeginImageContextWithOptions(image.size, NO, image.scale); 219 | 220 | CGContextRef context = UIGraphicsGetCurrentContext(); 221 | CGContextTranslateCTM(context, 0.0, image.size.height); 222 | CGContextScaleCTM(context, 1.0, -1.0); 223 | CGContextDrawImage(context, imageRect, image.CGImage); 224 | [color set]; 225 | UIRectFillUsingBlendMode(imageRect, kCGBlendModeSourceAtop); 226 | 227 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 228 | 229 | UIGraphicsEndImageContext(); 230 | 231 | return newImage; 232 | } 233 | 234 | - (void)generateWaveforms 235 | { 236 | CGRect rect = self.bounds; 237 | 238 | if (self.generatedNormalImage == nil && self.asset) { 239 | self.generatedNormalImage = [SCWaveformView generateWaveformImage:self.asset withColor:self.normalColor andSize:CGSizeMake(rect.size.width, rect.size.height) antialiasingEnabled:self.antialiasingEnabled]; 240 | _normalColorDirty = NO; 241 | } 242 | 243 | if (self.generatedNormalImage != nil) { 244 | if (_normalColorDirty) { 245 | self.generatedNormalImage = [SCWaveformView recolorizeImage:self.generatedNormalImage withColor:self.normalColor]; 246 | _normalColorDirty = NO; 247 | } 248 | 249 | if (_progressColorDirty || self.generatedProgressImage == nil) { 250 | self.generatedProgressImage = [SCWaveformView recolorizeImage:self.generatedNormalImage withColor:self.progressColor]; 251 | _progressColorDirty = NO; 252 | } 253 | } 254 | 255 | } 256 | 257 | - (void)drawRect:(CGRect)rect 258 | { 259 | [self generateWaveforms]; 260 | 261 | [super drawRect:rect]; 262 | } 263 | 264 | - (void)applyProgressToSubviews 265 | { 266 | CGRect bs = self.bounds; 267 | CGFloat progressWidth = bs.size.width * _progress; 268 | _cropProgressView.frame = CGRectMake(0, 0, progressWidth, bs.size.height); 269 | _cropNormalView.frame = CGRectMake(progressWidth, 0, bs.size.width - progressWidth, bs.size.height); 270 | _normalImageView.frame = CGRectMake(-progressWidth, 0, bs.size.width, bs.size.height); 271 | } 272 | 273 | - (void)layoutSubviews { 274 | [super layoutSubviews]; 275 | 276 | CGRect bs = self.bounds; 277 | _normalImageView.frame = bs; 278 | _progressImageView.frame = bs; 279 | 280 | // If the size is now bigger than the generated images 281 | if (bs.size.width > self.generatedNormalImage.size.width) { 282 | self.generatedNormalImage = nil; 283 | self.generatedProgressImage = nil; 284 | } 285 | 286 | [self applyProgressToSubviews]; 287 | } 288 | 289 | - (void)setNormalColor:(UIColor *)normalColor 290 | { 291 | _normalColor = normalColor; 292 | _normalColorDirty = YES; 293 | [self setNeedsDisplay]; 294 | } 295 | 296 | - (void)setProgressColor:(UIColor *)progressColor 297 | { 298 | _progressColor = progressColor; 299 | _progressColorDirty = YES; 300 | [self setNeedsDisplay]; 301 | } 302 | 303 | - (void)setAsset:(AVAsset *)asset 304 | { 305 | _asset = asset; 306 | self.generatedProgressImage = nil; 307 | self.generatedNormalImage = nil; 308 | [self setNeedsDisplay]; 309 | } 310 | 311 | - (void)setProgress:(CGFloat)progress 312 | { 313 | _progress = progress; 314 | [self applyProgressToSubviews]; 315 | } 316 | 317 | - (UIImage*)generatedNormalImage 318 | { 319 | return _normalImageView.image; 320 | } 321 | 322 | - (void)setGeneratedNormalImage:(UIImage *)generatedNormalImage 323 | { 324 | _normalImageView.image = generatedNormalImage; 325 | } 326 | 327 | - (UIImage*)generatedProgressImage 328 | { 329 | return _progressImageView.image; 330 | } 331 | 332 | - (void)setGeneratedProgressImage:(UIImage *)generatedProgressImage 333 | { 334 | _progressImageView.image = generatedProgressImage; 335 | } 336 | 337 | - (void)setAntialiasingEnabled:(BOOL)antialiasingEnabled 338 | { 339 | if (_antialiasingEnabled != antialiasingEnabled) { 340 | _antialiasingEnabled = antialiasingEnabled; 341 | self.generatedProgressImage = nil; 342 | self.generatedNormalImage = nil; 343 | [self setNeedsDisplay]; 344 | } 345 | } 346 | 347 | @end 348 | -------------------------------------------------------------------------------- /AudioWaveForm/Resources/SYWaveformPlayer/SYWaveformPlayerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SYWaveformPlayerView.h 3 | // SCWaveformView 4 | // 5 | // Created by Spencer Yen on 12/26/14. 6 | // Copyright (c) 2014 Simon CORSIN. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "SCWaveformView.h" 12 | 13 | @interface SYWaveformPlayerView : UIView 14 | 15 | - (id)initWithFrame:(CGRect)frame asset:(AVURLAsset *)asset color:(UIColor *)normalColor progressColor:(UIColor *)progressColor; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /AudioWaveForm/Resources/SYWaveformPlayer/SYWaveformPlayerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // SYWaveformPlayerView.m 3 | // SCWaveformView 4 | // 5 | // Created by Spencer Yen on 12/26/14. 6 | // Copyright (c) 2014 Simon CORSIN. All rights reserved. 7 | // 8 | 9 | #import "SYWaveformPlayerView.h" 10 | 11 | @implementation SYWaveformPlayerView { 12 | AVAudioPlayer *player; 13 | SCWaveformView *waveformView; 14 | UIButton *playPauseButton; 15 | UIView *vwMainWaveForm; 16 | } 17 | 18 | - (id)initWithFrame:(CGRect)frame asset:(AVURLAsset *)asset color:(UIColor *)normalColor progressColor:(UIColor *)progressColor { 19 | if (self = [super initWithFrame:frame]) { 20 | 21 | player = [[AVAudioPlayer alloc] initWithContentsOfURL:asset.URL error:nil]; 22 | player.delegate = self; 23 | 24 | vwMainWaveForm = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 50)]; 25 | vwMainWaveForm.layer.cornerRadius = 10.0; 26 | [vwMainWaveForm setBackgroundColor:UIColor.clearColor]; 27 | vwMainWaveForm.clipsToBounds = YES; 28 | [self addSubview:vwMainWaveForm]; 29 | 30 | 31 | waveformView = [[SCWaveformView alloc] init]; 32 | waveformView.normalColor = normalColor; 33 | waveformView.progressColor = progressColor; 34 | waveformView.alpha = 0.8; 35 | waveformView.backgroundColor = [UIColor clearColor]; 36 | waveformView.asset = asset; 37 | [vwMainWaveForm addSubview:waveformView]; 38 | 39 | playPauseButton = [UIButton buttonWithType:UIButtonTypeCustom]; 40 | [playPauseButton setImage:[UIImage imageNamed:@"playbutton.png"] forState:UIControlStateNormal]; 41 | [playPauseButton addTarget:self 42 | action:@selector(playPauseTapped) 43 | forControlEvents:UIControlEventTouchUpInside]; 44 | [self addSubview:playPauseButton]; 45 | 46 | [NSTimer scheduledTimerWithTimeInterval:0.1 target: self 47 | selector: @selector(updateWaveform:) userInfo: nil repeats: YES]; 48 | 49 | } 50 | 51 | return self; 52 | } 53 | 54 | - (void)layoutSubviews { 55 | [super layoutSubviews]; 56 | 57 | playPauseButton.frame = CGRectMake(5, 5, 40, 40); 58 | playPauseButton.layer.cornerRadius = self.frame.size.height/4; 59 | 60 | // waveformView.frame = CGRectMake(self.frame.size.height/2 + 10, 0, self.frame.size.width - (self.frame.size.height/2 + 10), self.frame.size.height); 61 | waveformView.frame = CGRectMake(playPauseButton.frame.size.width + 5, 0, vwMainWaveForm.frame.size.width, vwMainWaveForm.frame.size.height); 62 | } 63 | 64 | - (void)playPauseTapped{ 65 | if(player.playing){ 66 | [playPauseButton setImage:[UIImage imageNamed:@"playbutton.png"] forState:UIControlStateNormal]; 67 | [player pause]; 68 | } else { 69 | [playPauseButton setImage:[UIImage imageNamed:@"pausebutton.png"] forState:UIControlStateNormal]; 70 | [player play]; 71 | } 72 | } 73 | 74 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 75 | [self touchesMoved:touches withEvent:event]; 76 | [player pause]; 77 | } 78 | 79 | - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ 80 | UITouch *touch = [[event allTouches]anyObject]; 81 | CGPoint location = [touch locationInView:touch.view]; 82 | if(location.x/self.frame.size.width > 0) { 83 | waveformView.progress = location.x/self.frame.size.width; 84 | } 85 | } 86 | 87 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { 88 | NSTimeInterval newTime = waveformView.progress * player.duration; 89 | player.currentTime = newTime; 90 | [playPauseButton setImage:[UIImage imageNamed:@"pausebutton.png"] forState:UIControlStateNormal]; 91 | [player play]; 92 | 93 | } 94 | 95 | - (void)updateWaveform:(id)sender { 96 | 97 | if(player.playing) { 98 | waveformView.progress = player.currentTime/player.duration; 99 | } 100 | } 101 | 102 | - (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player 103 | successfully:(BOOL)flag { 104 | [playPauseButton setImage:[UIImage imageNamed:@"playbutton.png"] forState:UIControlStateNormal]; 105 | 106 | } 107 | @end 108 | -------------------------------------------------------------------------------- /AudioWaveForm/Resources/SYWaveformPlayer/pausebutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piyushghoghari08/AKWaveform/aead7593cdaffce44a1d8a7b476a830f5e5f3a34/AudioWaveForm/Resources/SYWaveformPlayer/pausebutton.png -------------------------------------------------------------------------------- /AudioWaveForm/Resources/SYWaveformPlayer/playbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piyushghoghari08/AKWaveform/aead7593cdaffce44a1d8a7b476a830f5e5f3a34/AudioWaveForm/Resources/SYWaveformPlayer/playbutton.png -------------------------------------------------------------------------------- /AudioWaveForm/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // AudioWaveForm 4 | // 5 | // Created by PIYUSH GHOGHARI on 04/02/19. 6 | // Copyright © 2019 AK_Creation. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | //MARK: - All IBOutlet's for this UIViewController 14 | 15 | @IBOutlet weak var vwAudioPlayerMain: UIView! 16 | @IBOutlet weak var vwDownload: UIView! 17 | @IBOutlet weak var vwDownloadProgress: UIView! 18 | @IBOutlet weak var vwAudioProgress: UIProgressView! 19 | 20 | @IBOutlet weak var lblMessage: UILabel! 21 | @IBOutlet weak var vwBtnDownload: UIView! 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | // Do any additional setup after loading the view, typically from a nib. 26 | vwDownload.layer.cornerRadius = 10.0 27 | vwDownload.layer.masksToBounds = true 28 | vwDownload.layer.borderColor = UIColor.white.cgColor 29 | vwDownload.layer.borderWidth = 2.0 30 | 31 | vwAudioPlayerMain.layer.cornerRadius = 10.0 32 | vwAudioPlayerMain.layer.masksToBounds = true 33 | vwAudioPlayerMain.layer.borderColor = UIColor.white.cgColor 34 | vwAudioPlayerMain.layer.borderWidth = 2.0 35 | vwBtnDownload.layer.cornerRadius = 20.0 36 | vwBtnDownload.layer.masksToBounds = true 37 | vwBtnDownload.layer.borderColor = UIColor.white.cgColor 38 | vwBtnDownload.layer.borderWidth = 2.0 39 | vwDownloadProgress.isHidden = true 40 | } 41 | 42 | @IBAction func btnCancelClick(_ sender: UIButton) { 43 | SDDownloadManager.shared.cancelDownload(forUniqueKey: "http://www.jplayer.org/audio/m4a/TSP-01-Cro_magnon_man.m4a") 44 | } 45 | 46 | @IBAction func btnDownloadAudioClick(_ sender: UIButton) { 47 | self.lblMessage.isHidden = true 48 | self.vwDownloadProgress.isHidden = false 49 | let url = URL(string: "http://www.jplayer.org/audio/m4a/TSP-01-Cro_magnon_man.m4a") 50 | let request = URLRequest.init(url: url!) 51 | let date :NSDate = NSDate() 52 | let dateFormatter = DateFormatter() 53 | dateFormatter.dateFormat = "yyyy-MM-dd'_'HH_mm_ss" 54 | let downloadAudioURL = SDDownloadManager.shared.dowloadFile(withRequest: request, 55 | inDirectory: "\(dateFormatter.string(from: date as Date))", 56 | withName: nil, 57 | onProgress: { [weak self] (progress) in 58 | print("Download progress : -> \(Float(progress))") 59 | self?.vwAudioProgress.setProgress(Float(progress), animated: true) 60 | }) { [weak self] (error, url) in 61 | if let error = error { 62 | print("Error is \(error as NSError)") 63 | } else { 64 | if let url = url { 65 | self?.vwDownload.isHidden = true 66 | let asset : AVURLAsset = AVURLAsset.init(url: url, options: nil) 67 | print("Audio Local URL : ->",asset.url) 68 | print(self?.vwAudioPlayerMain.frame.size.width as Any) 69 | let playerView = SYWaveformPlayerView(frame: CGRect(x: 0, y: 0, width: (self?.vwAudioPlayerMain.frame.size.width)!, height:50), asset: asset, color: UIColor.gray, progressColor: UIColor(red: 132.0/255.0, green: 112.0/255.0, blue: 255.0/255.0, alpha: 1.0)) 70 | self?.vwAudioPlayerMain.addSubview(playerView!) 71 | } 72 | } 73 | } 74 | print("Audio URL :- \(downloadAudioURL!)") 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /AudioWaveFormTests/AudioWaveFormTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AudioWaveFormTests.swift 3 | // AudioWaveFormTests 4 | // 5 | // Created by PIYUSH GHOGHARI on 04/02/19. 6 | // Copyright © 2019 AK_Creation. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import AudioWaveForm 11 | 12 | class AudioWaveFormTests: XCTestCase { 13 | 14 | override func setUp() { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /AudioWaveFormTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /AudioWaveFormUITests/AudioWaveFormUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AudioWaveFormUITests.swift 3 | // AudioWaveFormUITests 4 | // 5 | // Created by PIYUSH GHOGHARI on 04/02/19. 6 | // Copyright © 2019 AK_Creation. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class AudioWaveFormUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | 16 | // In UI tests it is usually best to stop immediately when a failure occurs. 17 | continueAfterFailure = false 18 | 19 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 20 | XCUIApplication().launch() 21 | 22 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 23 | } 24 | 25 | override func tearDown() { 26 | // Put teardown code here. This method is called after the invocation of each test method in the class. 27 | } 28 | 29 | func testExample() { 30 | // Use recording to get started writing UI tests. 31 | // Use XCTAssert and related functions to verify your tests produce the correct results. 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /AudioWaveFormUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AKWaveform 2 | 3 | 4 |

Usage & Contribute

5 | 6 | SYWaveformPlayer + SDDownloadManager = WAVWFORM 7 | 8 | 9 |

> This AKWaveform Library soluation is combination of two other library. one of SYWaveformPlayer and another is SDDownloadManager.

10 | 11 |

> AKWaveform Library used for multiple audio file download, save device storage and convert into waveform.

12 | 13 |

Features

14 | 15 |

> Multiple audio file download.

16 |

> Convert audio file to waveform.

17 |

> Save into local storage.

18 | 19 |

Requirements

20 |

> Add below code into Info.plist

21 |

> Application supports iTunes file sharing - Bool - YES

22 |

> Supports opening documents in place - Bool - YES

23 |

> add NSAllowsArbitraryLoads

24 | 25 |

Dependencies

26 | SYWaveformPlayer
27 | SDDownloadManager 28 | -------------------------------------------------------------------------------- /ScreenShorts/Simulator Screen Shot - iPhone 6s - 2019-02-04 at 21.08.11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piyushghoghari08/AKWaveform/aead7593cdaffce44a1d8a7b476a830f5e5f3a34/ScreenShorts/Simulator Screen Shot - iPhone 6s - 2019-02-04 at 21.08.11.png -------------------------------------------------------------------------------- /ScreenShorts/Simulator Screen Shot - iPhone 6s - 2019-02-04 at 21.08.15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piyushghoghari08/AKWaveform/aead7593cdaffce44a1d8a7b476a830f5e5f3a34/ScreenShorts/Simulator Screen Shot - iPhone 6s - 2019-02-04 at 21.08.15.png -------------------------------------------------------------------------------- /ScreenShorts/Simulator Screen Shot - iPhone 6s - 2019-02-04 at 21.08.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piyushghoghari08/AKWaveform/aead7593cdaffce44a1d8a7b476a830f5e5f3a34/ScreenShorts/Simulator Screen Shot - iPhone 6s - 2019-02-04 at 21.08.16.png --------------------------------------------------------------------------------