Skip to content

TeamLetrando/SoundsKit

Repository files navigation

SoundsKit

SPM ready

Overview

SoundsKit is a simple library that lets you deal with Swift sounds easily.

Creating instances of SoundsKit class

Specify a file for your sound manager:

SoundsKit.file

Specify a extension file for your sound manager. The default value is mp3:

SoundsKit.fileExtension

Creating an instance has more benefits in managing your app sounds.

Static methods

Play sound:

SoundsKit.play()

Pause currently playing sound:

SoundsKit.pause()

Stop currently playing sound:

SoundsKit.stop()

Play speech in any language. The default value is "pt-BR".

SoundsKit.reproduceSpeech(_ text: String, language: String)

Enable/disable sound:

SoundsKit.setKeyAudio(true)
SoundsKit.setKeyAudio(false)

The value of SoundsKit.setKeyAudio(_ key: Bool) property will be automatically persisted in UserDefaults and restored on the next launch of your app.

Check enable/disable sound:

SoundsKit.audioIsOn()

Team Letrando ABC

There are some functions for Letrando app.

Play Background Sound Letrando ABC:

SoundsKit.playBackgroundLetrando()

Play Alert Sound Letrando ABC:

SoundsKit.playAlert()

Play Onboarding Sound Letrando ABC:

  • Parameter at: Select the audio for each page onboarding
SoundsKit.playOnboardingLetrando(at : Int)

Control Onboarding finish Letrando ABC:

  • Parameter at: Select the audio for each page onboarding
SoundsKit.finishOnboarding(at index: Int)

Acess for Control Onboarding finish Letrando ABC:

SoundsKit.isFinishOnboarding()

There are some functions for Formando app.

Play Background Sound Formando:

SoundsKit.playBackgroundFormando()

Play Onboarding Sound Formando:

  • Parameter at: Select the audio for each page onboarding
SoundsKit.playOnboardingFormando(at : Int)

Play Alert Sound Formando:

SoundsKit.playAlertFormando()

Features

  • Ability to resume
  • Adjusting sound volume

Requirements

  • Swift 5
  • iOS 13.0 or later

Installation

Installation with Swift Package Manager

The Swift Package Manager is a tool for managing the distribution of Swift code. Just add the url of this repo to your Package.swift file as a dependency:

import PackageDescription

let package = Package(
    name: "SoundsKit",
    platforms: [.iOS(.v13)],
    products: [
        .library(
            name: "SoundsKit",
            targets: ["SoundsKit"]),
    ],
    dependencies: [
    ],
    targets: [
        .target(
            name: "SoundsKit",
            dependencies: [],
            path: "Sources",
            resources: [.process("SoundsKit/Resources/onboarding0.wav"),
                        .process("SoundsKit/Resources/onboarding1.wav"),
                        .process("SoundsKit/Resources/onboarding2.wav"),
                        .process("SoundsKit/Resources/Curious_Kiddo.mp3"),
                        .process("SoundsKit/Resources/audio01.wav"),
                        .process("SoundsKit/Resources/Formando/Play_Date.mp3"),
                        .process("SoundsKit/Resources/Formando/audio01_Formando.mp3"),
                        .process("SoundsKit/Resources/Formando/onboarding0_Formando.mp3"),
                        .process("SoundsKit/Resources/Formando/onboarding1_Formando.mp3"),
                        .process("SoundsKit/Resources/Formando/onboarding2_Formando.mp3")]),
        .testTarget(
            name: "SoundsKitTests",
            dependencies: ["SoundsKit"],
            resources: [.process("Resources/corrupt.pdf"), .process("Resources/test.wav")]),
    ]
)

Then run swift build and wait for SPM to install SoundsKit.

Manual installation

Drop the SoundsKit.swift file into your project, link against AVFoundation.framework and you are ready to go.

Licenses

SoundsKit is licensed under the MIT License.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages