Code Monkey home page Code Monkey logo

ionic-soundboard's Introduction

Ionic 3 Soundboard

This app takes a collection of sounds from a custom URL. That way sounds can be added and removed at will, while still keeping the app code the same. The app makes use of Ionic 3 with TypeScript.

Note: Some of the Ionic Native features (such as caching) add quite a bit of complexity to the code. For a more simple version of the app without these native features you can check out the 'simple' branch.

Prerequisities

Assumes that Homebrew is installed. For alternative installation options for Node, refer to their website

brew install node
npm install -g cordova
npm install -g ionic

Setup

Assumes that Git is installed along with the prerequisites.

git clone [email protected]:rkalis/ionic-soundboard.git
cd ionic-soundboard
npm install

Then run it locally with any of the following

ionic serve --lab
ionic cordova run ios
ionic cordova run android

The first one running it in the browser, while the others run on a device or emulator. Note that Ionic Native features (such as caching) are disabled in the browser.

Features

The app is a simple soundboard, with a list of sounds, which can be played, and stopped when they are playing. In the soundboard, you have the option to mark certain sounds as favourites, moving them to the top of the list. This way, you can have all your favourite sounds right there at your fingertips. When running on a native platform (iOS, Android, etc.), every sound is cached for seven days when playing it. That way the sounds can still be accessed when there is no internet connection. Local caching can be enabled or disabled, and the cache can be cleared in the preferences menu.

Customising

Title & Default Preferences

Open ionic-soundboard/src/pages/soundboard/soundboard.ts to edit the title variable.

Open ionic-soundboard/src/services/preferences.service.ts to edit the default preferences:

get DEFAULT_PREFERENCES() {
  return {
    baseUrl: 'http://kalis.me',
    soundsFile: '/sounds.json',
    cachingEnabled: true
  };
}

Edit the default values to point to your own base url and your own sounds file.

Icon & Splash Screen

Replace ionic-soundboard/resources/icon.png and ionic-soundboard/resources/splash.png with your own files. Then run:

ionic cordova resources ios
ionic cordova resources android

Usage

There should be a file at the path specified by preferenceService.get('baseUrl') + preferenceService.get('soundsFile') containing a json array with objects in the following format:

{
    "title": "Sample Title",
    "file": "/sample_sound.mp3"
}

For example http://misc.kalis.me/sounds.json looks like this:

[
    {
        "title": "Bird",
        "file": "/res/bird.mp3"
    },
    {
        "title": "Cat",
        "file": "/res/cat.mp3"
    },
    {
        "title": "Cow",
        "file": "/res/cow.mp3"
    },
    {
        "title": "Dog",
        "file": "/res/dog.mp3"
    },
    {
        "title": "Dolphin",
        "file": "/res/dolphin.mp3"
    },
    {
        "title": "Frog",
        "file": "/res/frog.mp3"
    },
    {
        "title": "Pig",
        "file": "/res/pig.mp3"
    }
]

Resulting in this soundboard: Soundboard

Testing/Building/Publishing

Please refer to the ContactApp Wiki for a comprehensive guide to testing, building, and publishing Ionic apps. Do note that the ContactApp was written in an older version of Ionic.

ionic-soundboard's People

Contributors

rkalis avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

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

  • D3 photo D3

    Data-Driven Documents codes.