Coder Social home page Coder Social logo

andreasotto / nativescript-audio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nstudio/nativescript-audio

0.0 2.0 0.0 18.98 MB

:microphone: :musical_note: NativeScript plugin to record and play audio :musical_note: :microphone:

License: Other

TypeScript 97.91% CSS 2.09%

nativescript-audio's Introduction

npm npm

NativeScript-Audio

NativeScript plugin to play and record audio files for Android and iOS.

Uses the following native classes:

Android

iOS

Installation

npm install nativescript-audio

Sample Screen

AudioExample

API

TNSRecorder

Method Description
TNSRecorder.CAN_RECORD(): boolean Determine if ready to record.
start({ filename: string, errorCallback?: Function, infoCallback?: Function }): Promise Start recording file.
stop(): void Stop recording.
dispose(): void Free up system resources when done with recorder.

TNSPlayer

Method Description
playFromFile( { audioFile: string, completeCallback?: Function, errorCallback?: Function, infoCallback?: Function; } ): Promise Play from a file.
playFromUrl( { audioFile: string, completeCallback?: Function, errorCallback?: Function, infoCallback?: Function; } ): Promise Play from a url.
pause(): void Pause playback.
seekTo(time:number): Promise<boolean> Seek to position.
dispose(): void Free up resources when done playing audio.
isAudioPlaying(): boolean Determine if player is playing.
getAudioTrackDuration(): Promise duration of media file assigned to mediaPlayer

Why the TNS prefixed name?

TNS stands for Telerik NativeScript

iOS uses classes prefixed with NS (stemming from the NeXTSTEP days of old): https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/

To avoid confusion with iOS native classes, TNS is used instead.

License

MIT

nativescript-audio's People

Contributors

andreasotto avatar bradmartin avatar dylanryan avatar nathanwalker avatar

Watchers

 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.