Sound Control

Discussion in 'Web Call Server 4' started by Sajin, Oct 16, 2015.

  1. Sajin

    Sajin New Member

    How we can play sounds such as ring, call end etc? What files need to be included?
    Or a documentation link where I can find those informations
  2. Max

    Max Administrator Staff Member

    First of all you can check example Phone.html / Phone.js
    It is full sample with UI and it plays sounds.
    Then you can check phone/SoundControl.js and phone/sounds to see how it is implemented

    In Phone-min.js you can see
    Code:
    f.addListener(WCSEvent.CallStatusEvent, callStatusListener);
    So you can play any desired sound on appropriate call status.
    Just trace this event (callStatusListener) method to see call statuses.
  3. Sajin

    Sajin New Member

    Actually I got the idea regarding the callStatusListener, and how it works already. Also when I need to play sound, where I need to put the code for playing sound etc.
    But the problem is when I call SoundControl.getInstance(), it results in an error in ConfigurationLoader.js.
    [ me.configLoadedListener.apply(this, [me.configuration]); --> Cannot call apply of undefined]..
    So guessing I'm doing something wrong
  4. Max

    Max Administrator Staff Member

    SoundControl.js is just example.
    It is not a part of API (Flashphoner.js).
    So you have to rewrite this to use your own HTML5 sounds. You can also use any other script for such purpose.
    Example:
    Code:
    var audio = new Audio('audio_file.mp3');
    audio.play();
  5. Sajin

    Sajin New Member

    Ahh, I see now, got it, SoundControl.js just creating HTML5 audio element and playing the sounds. Its is to manage sounds in that particular example.
    Thanks Max. :)

Share This Page