Giter Site home page Giter Site logo

datacompboy / wavplayer Goto Github PK

View Code? Open in Web Editor NEW
90.0 14.0 26.0 1.35 MB

Flash player for telephony files (.wav, .au, .gsm, .alaw, .ulaw, .la, .lu, .sln)

License: GNU General Public License v3.0

Haxe 85.96% JavaScript 8.55% Makefile 0.06% HTML 5.44%

wavplayer's Introduction

WavPlayer -- flash player for asterisk

* Note: Use Haxe-2 to compile.

    WavPlayer is flash player, designed to play files, recorded for and 
    by Asterisk (www.asterisk.org) or any other telephone system.

    If supports playback of:
    Format | Codecs
    =====================================================================
    .au     G711u, G711a, PCM format, any samplerate/channels
    .wav    G711u, G711a, PCM, GSM 6.10 (MS), IMA ADPCM formats, any samplerate/channels
     .wav49 just alias of .wav, can content any of wav codecs
    .gsm    raw GSM 6.10
    .sln    raw PCM 16bit-signed 8kHz
     .raw   alias of .sln
    .alaw   raw G711a 8kHz mono
     .al    alias of .alaw
    .ulaw   raw G711u 8kHz mono
     .ul    alias of .ulaw
     .mu    alias of .ulaw
     .pcm   alias of .ulaw
    .la     raw G711a 8kHz mono in inverted bit order
    .lu     raw G711u 8kHz mono in inverted bit order
    =====================================================================

Flash interface:
    You can select one of two interfaces:
    1: (minimal) Just one button. 
            To select it, pass gui=mini in agruments, or nothing
        shape of circle = buffering, click to stop
        shape of square = playing, click to pause playback
        shape of triangle = stopped, click to play last file
        shape of two bars = paused. click to continue play
    2: (wide) Control button as above plus position bar for scrolling
            To select it, pass gui=full in arguments
        short ticks are 10 second, long ticks are minutes.
        pass arguments: h=height of player, w=width of player.
            field of control button are square of h*h, rest space used for
            position bar.
    3: (none) no interface at all. transparent dot displayed.
            To select it, pass gui=none in arguments

Flash Interface customize:
    Pass parameters to specify colors:
        bg_color:     (default 0x303030) Color of background
        ready_color:  (default 0xA0A0A0) Color of loaded bar
        cursor_color: (default 0x7FA03F) Color of cursor mark
        button_color: (default 0x808080) Color of play/pause button

        minor_tick_color: (default 0x006600) Color of minor tick score
        major_tick_color: (default 0x000066) Color of major tick score

JS interface:
    doPlay([filename][, buffer]) or play([filename][, buffer])
        start playback of given filename. if filename not given -- play last
        buffer argument says minimum buffer length needed to start playback
    doStop() or stop()
        stop playback of current file
    doPause() or pause()
        pauses playback of current file
    doResume() or resume()
        resume playback of current file after pause. will throw error if not started
    doSeek(pos) or seek()
        seeks playback to position (in seconds)
    setVolume(value) or volume(value)
        set playback volume to specifed value. 1.0 by default
        initial value get from flash parameter "value"
    getVolume() or volume()
        get playback volume
    setPan(value) or pan(value)
        set playback pan (-1.0 is 100% left, 0.0 is center(default), 1.0 is 100% right)
        initial value get from flash parameter "pan"
    getPan(value) or pan()
        get playback pan
    attachHandler(Event, Handler[, User]) -> handlerId
        when Event occurs, Handler will be called, with optionally User info as first argument
    detachHandler(Event, Handler[, User])
        detach all Event handlers, identified by Event/Handler/User triplet
    removeHandler(HandlerId)
        detach event handler, identified by handlerId, returent by previous call to attachHandler

JS callbacks:
    onWavPlayerReady(id)
        fired when wavPlayer ready to be controlled

JS events:
        !!! WARNING !!! 
        Do not do any time-consuming operations in callbacks -- 
            It can cause hangs from browser to whole system.
        To change any DOM elements / innerHTML / ask user --
            fire function in separate thread with setTimeout()
        !!! ACHTUNG !!!

    *(eventName[, User][, Arguments])
        fired on any events. first argument then eventName, next is user-supplied argument, rest is event arguments
    PLAYER_BUFFERING([position])
        fired when player starts buffering of sound.
        optionally, passed current file position (if known)
    PLAYER_LOAD(soundAvailable, soundTotal)
        fired when player loads sound stream.
        soundAvailable = sound length in seconds available to play right now
        soundTotal = total sound length in file, if known
    PLAYER_PLAYING([position])
        fired when player starts playing sound
        start of playback position passed, if position known
    PLAYER_STOPPED([position])
        fired when player stops playing sound
        stopped position passed, if known
    PLAYER_PAUSED([position])
        fired when player paused playing sound
        current pause position passed, if known
    progress(bytesLoaded, bytesTotal)
        fired when player loaded next chunk from file.

See usage example in debug.html and index.html

wavplayer's People

Contributors

cventers avatar datacompboy avatar francois2metz avatar mogorman avatar osharper avatar pgrange avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wavplayer's Issues

How change button color

I can't understand, in readme said "bg_color" option to set background color, but in example it "bgcolor".
I try use "button_color" but nothing changes, I try without "_" behavior same.
How change button color?

wavplayer index.html not working properly

I try to use your wavplayer from https://github.com/francois2metz/WavPlayer. for that i download the zip file and try to run the index.html file but it plays only from the embed tag and the links like doplay (), doplay() setvolume.... and the like links are not working. For that anything i want to add?

and also how to do autoplay like

wavplayer.swf?gui=full&h=30&w=300&sound=/attachment/&autoplay=1&

problem on ubuntu

Hi
i am using this wavplayer and it is working on MAC and Ubuntu while playing gsm file but in Ubutnu it is not working only showing undefined on hover

When I seek a ADPCM file, sound crack occurs

I try to use your wavplayer to play a ADPCM encoded wav file.When I use JS interface doSeek(pos),sound crack occurs.The problem occurs with ADPCM only.
trace show "Need to seek in past, we can't" or "Need to seek in future, we can't" the problem occurs.

Flash end of support on December 31, 2020

Hi,
I wondering if flash end of support, I can continue use wavplayer to play file audio .WAV (not .wav) or need to find other method to play audio because I was spending time to find solution for play audio file for .WAV but nothing come out yet.
I will be appreciate any suggests or solutions for this issue. Thank you in advance and hope to get reply from you soon.

play wav files using URL

Playback volume too low

First of all, this is a great piece of sotware - thank you for releasing it.

My only issue, is that the playback volume is significantly lower than the system volume (playing same file in a media player etc).

Is there anyway to boost the playback volume in the Flash Player?

Error when building

I get an error when trying to build:

WavPlayer blah$ haxe release.hxml
Player.hx:21: characters 49-50 : Unexpected ,

Do I need a specific version of haxe?

Additional parameter to specify the file format

I need to play files that are not on the filesystem and therefore don't have an extension.
It would be very interesting to be able to specify the file format on an additional parameter.

Example: doPlay([filename][, buffer][, format])

What do you think?

Filipe Múrias

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.