1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    2
    Vote Rating
    0
    eloreal is on a distinguished road

      0  

    Question Music Library for Sencha Animator

    Music Library for Sencha Animator


    Hello,

    What is the best js sound library to use in Sencha animator, to allow sounds on iPhone / iPad ?
    I need sounds that can be linked to event.
    Is it possible to create events in Sencha Animator, or do I have to manage events myself in js ?

    Best regards,
    Emmanuel

  2. #2
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    10
    arnebech will become famous soon enough

      0  

    Default


    You should be able to use any sound library.

    To include a external library in Animator, go to the Project tab in the property panel. There you can add a script tag to your library in the "Head HTML" section e.g.

    Code:
    <script src="http://link/to/buzz.js"></script>
    You could also add a link to some initialization code you have as well, or write it directly in a script tag e.g.
    Code:
    <script type="text/javascript">
    //set up some sounds
    soundA = new Sound(......
    </script>
    Finally, to tie it in to click events in Sencha Animator you can use the "Click Action" property of any stage object and set it to "Custom JS" and then open up your editor and add the js to play some sounds e.g.
    Code:
    soundA.play() //or something similar

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    2
    Vote Rating
    0
    eloreal is on a distinguished road

      0  

    Default Custom Events

    Custom Events


    Thank you,

    I had thought of using Buzz library sound! So I will.
    Everything is clear.

    But there is a point i'm interested in also.
    I want to fire events (that play sounds), but not only on mouse click on any image, but on image appearing. Is it possible ? Can I create custom events and fire them when a specific image appears on the scene ?

    Thank you,
    Best regards.

  4. #4
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    10
    arnebech will become famous soon enough

      0  

    Default


    Currently there are four types of events that are exposed in animator.
    • Click
    • Scene Start
    • Scene End
    • Mouse move
    We're working on adding more. If you need more events you can add your own javascript to handle that. One way to go about adding your own events is to give objects in Animator a "CSS ID" and then you can refer to them from javascript by using document.getElementById('theObjectID') and attach events.

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
    danboid is on a distinguished road

      0  

    Default what am I missing?

    what am I missing?


    Hi!

    I'm a total beginner with both Animator and JS so I'd be very happy if someone could explain why I can't get buzz.js to play the first 30s of my 3m ogg file (under Linux) when a new scene is opened although I can hear the examples (under Firefox/Iceweasel) on the buzz.js homepage fine.

    From reading this thread and the buzz docs, my guess was that if I put:

    Code:
    <script src="/linux/path/to/buzz.js"></script>
    
    <script type="text/javascript">
    var mysound = new buzz.sound("/linux/path/to/my.ogg");
    </script>
    In Project > Export > Head HTML then for the scene that I want to trigger the playing of my.ogg with buzz.js I have inserted under Properties > Actions > Custom JS

    Code:
    mysound.setTime( buzz.fromTimer("00:30") );
    I'm not hearing anything yet - please help!

  6. #6
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    10
    arnebech will become famous soon enough

      0  

    Default


    Not very familiar with Buzz, but have you tried adding the .play method?

    E.g.

    Code:
    mysound.setTime( buzz.fromTimer("00:30") );
    mysound.play();
    Also, have you checked the js console for any errors?

  7. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
    danboid is on a distinguished road

      0  

    Default


    Hi arnebech!

    First off, I forgot to say thanks in my previous posting (which was the first on these forums) to Sencha for releasing Linux builds of Animator because Linux has needed an alternative to Flash (and now Edge of course) for a long time so Animator fills a previously void yet important niche in the Linux graphics and web design stack and is what I shall be recomending for that purpose now it seems.

    You were correct

    Code:
    mysound.play();
    Is actually all that was required for the custom JS code to trigger my ogg file

    Code:
    mysound.setTime( buzz.fromTimer("00:30") );

    Is only required if you want to start playback from 30s in.

    Thanks!

  8. #8
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    10
    arnebech will become famous soon enough

      0  

    Default


    I have seen buzz working with Safari. Does it work in Chrome? Have you checked for any js errors, and are you sure the path is correct?

Thread Participants: 2

Tags for this Thread