A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 30

Thread: Aud-Comments

  1. #1
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205

    Aud-Comments

    Here is a zip file with my Audio Commenting system for teachers. The audio is just for demonstration. The instructions are aimed at total newbies.

    Comments and suggestions most welcome. And thanks again to all for the help.
    Attached Files Attached Files
    Last edited by jimventola; 08-22-2006 at 02:34 PM.

  2. #2
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205

    Sound not playing fully from server

    I finally got this uploaded to my server and discovered the audio is not working right. I have to click the button repeatedly to get the file to play through, and these are very short files. You can see what I mean at

    faculty.massasoit.mass.edu/jventola/ac/Aud-Comments.html

    It appears as if the sound files are getting clipped at the end. Is this just a natural result of the slowness of the streaming? Usually, once the sound starts there is no problem.

    Can I fix this?
    Last edited by jimventola; 08-22-2006 at 07:30 PM.

  3. #3
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    http://www.diversioncentral.com/jim/Aud-Comments.html

    tell me how it sounds here. seems ok to me.
    Any programming language is at its best before it is implemented and used.

  4. #4
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205

    sounds fine

    Quote Originally Posted by tmoore935
    http://www.diversioncentral.com/jim/Aud-Comments.html

    tell me how it sounds here. seems ok to me.

    Thanks for this experiment.

    It sounds fine at diversioncentral. I guess that means my college server is at fault?

    BTW--I noticed the pushbuttons only change color on a click the first time or so. After that, they remain inert when I click. Is this normal? (These are component pushbuttons.)

  5. #5
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    To be honest I have never used the components since i still live in the flash 5/6 days. But I do not recal ever seeing any color change.
    Any programming language is at its best before it is implemented and used.

  6. #6
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    I think you've got a coding problem somewhere. The whole movie becomes unresponsive once I push the read along button. And I notice that FireFox is trying to retreive data continuously from the server.

    How are you loading the audio, and are you tracking the load at all?

  7. #7
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205
    Quote Originally Posted by blanius
    How are you loading the audio, and are you tracking the load at all?
    Good hunch, Bret.
    Here is the code I am using. As you can see, I (probably foolishly) commented out some code from Chris to see if it was needed. Probably is.

    The reason for this surgery, er butchery, was that I wanted to avoid the checking for the max number of audio files. My first approach was just to set NAF to the number of audio files in KM; but I wanted the SWF to work for anyone even without KM, and I wasn't sure why you have to check to see if the current audio is the last audio file. Maybe it is needed, though. Or maybe I got rid of something else important?

    I hope this can be fixed without requiring that the movie know the total number of audio files. Otherwise, I will have to have some way for the user to input that info for the code to use.



    Code:
    p1.onPress=function(){
     _root.mySound.stop();
    //if(contentpane1.getPage()<naf){
    
    _root.mySound = new Sound(mySprite);
         _root.mySound.loadSound("Reading"+contentpane1.getPage()+".mp3", true);
          _root.mySound.setVolume(100);
         _root.mySound.start();
    
    //}else{
    //if(contentpane1.getPage()=naf){
    
    //_root.mySound = new Sound(mySprite);
     //    _root.mySound.loadSound("Reading"+contentpane1.getPage()+".mp3", true);
     //     _root.mySound.setVolume(100);
      //   _root.mySound.start();
    //
    }
    //}
    //}
    //
    p2.onPress=function(){
     _root.mySound.stop();
    //if(contentpane1.getPage()<naf){
    
    _root.mySound = new Sound(mySprite);
         _root.mySound.loadSound("Comment"+contentpane1.getPage()+".mp3", true);
          _root.mySound.setVolume(100);
         _root.mySound.start();
    
    //}else{
    //if(contentpane1.getPage()=naf){
    
    //_root.mySound = new Sound(mySprite);
     //    _root.mySound.loadSound("Comment"+contentpane1.getPage()+".mp3", true);
       //   _root.mySound.setVolume(100);
       //  _root.mySound.start();
    
    }
    //}
    //}

  8. #8
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205

    Then again

    I uploaded a newer version.
    faculty.massasoit.mass.edu/jventola/ac/Aud-Comments.html

    It seems to work better now.

    Wilbert sent me a bugfix. I am not sure if that's all it was. Or why it would work better from a different server.

    Please check it out and let me know if it works ok. Thanks again.

  9. #9
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Does not work correctly for me. on the second page the voice cuts out and never finishes. This is only a wild wild guess but did you upload the mp3 as binary or ascii?
    Any programming language is at its best before it is implemented and used.

  10. #10
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205
    Quote Originally Posted by tmoore935
    This is only a wild wild guess but did you upload the mp3 as binary or ascii?
    Hmmnnn..... rubbing chin.....
    Actually, I used NetDrive and just dragged and dropped!

    I've uploaded some slightly longer ones, this time as binary using FTP.

    But audio still stutters.

  11. #11
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    I never hear the audio. It could just be your server is too slow to stream. You may just need to load the files differently.

    If you load with streaming set to false you can then use getBytesLoaded and getBytesTotal to see how much is loaded then play it or even use onLoad Here is an example from the MM livedocs
    Try making a short test using the code below and see how well your server is sending an MP3.


    The following example dynamically creates two text fields that display the bytes that are loaded and the total number of bytes for a sound file that loads into the SWF file. A text field also displays a message when the file finishes loading. Add the following ActionScript to your FLA or AS file:

    this.createTextField("message_txt", this.getNextHighestDepth(), 10,10,300,22)
    this.createTextField("status_txt", this.getNextHighestDepth(), 10, 50, 300, 40);
    status_txt.autoSize = true;
    status_txt.multiline = true;
    status_txt.border = false;

    var my_sound = new Sound();
    my_sound.onLoad = function(success:Boolean) {
    if (success) {
    this.start();
    message_txt.text = "Finished loading";
    }
    };
    my_sound.onSoundComplete = function() {
    message_txt.text = "Clearing interval";
    clearInterval(my_interval);
    };
    my_sound.loadSound("song2.mp3", true);
    var my_interval;
    my_interval = setInterval(checkProgress, 100, my_sound);
    function checkProgress(the_sound) {
    var pct = Math.round(the_sound.getBytesLoaded()/the_sound.getBytesTotal() 100);
    var pos = Math.round(the_sound.position/the_sound.duration 100);
    status_txt.text = the_sound.getBytesLoaded()+" of "+the_sound.getBytesTotal()+" bytes ("+pct+"%)"+newline;
    status_txt.text += the_sound.position+" of "+the_sound.duration+" milliseconds ("+pos+"%)"+newline;
    }

  12. #12
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205
    Quote Originally Posted by blanius
    I never hear the audio. It could just be your server is too slow to stream. You may just need to load the files differently.
    Thanks Bret. I will try to play with this. The odd thing is that I have plenty of audio streaming just fine from the same server. The difference is those were done with Wicked Streaming Program, which converts the audio to swf files and then plays them from a controller movie. I have 20 minute lectures that stream along. In fact, they even will stream to dial-up.

    Wilbert suggested I change the onPress to onClick, since the first is for GUI buttons and the other is for component buttons, like these. I did that and re-upped, with still no joy. Naturally, it works perfectly locally.

    I wonder if it could have to do with setting in Audacity or maybe the KM Export? But then, why does the original work fine from Diversion Central? That would suggest a server issue. Frustrating....
    Last edited by jimventola; 08-23-2006 at 01:53 PM.

  13. #13
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    The button itself works fine now.

    Try
    _root.mySound = new Sound();
    instead of
    _root.mySound = new Sound(mySprite);

    Does that make a difference ?

  14. #14
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    That originated in one of my Swish movies and on port over was left which refers to something he doesn't use....it's always the small stuff that gets by......sorry.

  15. #15
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Which brings me back to how different Swish scripting is....not only do you have to learn it you have to deal with all the little oddities of it's syntax so stuff like that is what ends up biting you when you are tired and pissed you even have to edit lines of code because they refuse to get with it as far as normal actionscripting. Sorry again....

  16. #16
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205
    Quote Originally Posted by w.brants
    The button itself works fine now.

    Try
    _root.mySound = new Sound();
    instead of
    _root.mySound = new Sound(mySprite);

    Does that make a difference ?
    No difference. I am still getting strangeness. I went right to page two and the Reading played fine. Came back to page one, and it took a while to start and then cut out until I clicked repeatedly.

  17. #17
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Jim, you are right that it's a server problem.
    The fun file you PMed me also won't open.

    If I try to access the mp3 directly this one plays fine
    http://www.diversioncentral.com/jim/Reading1.mp3
    and this one not
    http://faculty.massasoit.mass.edu/jv...c/Reading1.mp3

    Even stranger... both files play fine when I open the url in windows media player but for some reason the webbrowser and flashplayer have a problem with opening the mp3 file from the mass.edu server.

  18. #18
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205
    Quote Originally Posted by Chris_Seahorn
    That originated in one of my Swish movies and on port over was left which refers to something he doesn't use....it's always the small stuff that gets by......sorry.
    I don't think this really bit us this time. Your code works fine locally and also from TMoore's site (see above).

    It must be something with the server, even though the server streams other audio fine. I'm going to ask a friend to put it on his server to see if it works any better from there.

  19. #19
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205
    Quote Originally Posted by w.brants
    Jim, you are right that it's a server problem.
    The fun file you PMed me also won't open.
    Strange. Try this one; it is the current version.

    Actually, when I just opened Reading1 on diversioncentral, it opened and played halfway in the QT player. I had to click play again, and then it worked. Very similar to what happens on the Massa server. BTW, the files are different since I wanted to re-upload as binary.

    So now I am suspecting the mp3 files themselves. They were made with Audacity and Lame.
    Attached Files Attached Files
    Last edited by jimventola; 08-23-2006 at 02:24 PM.

  20. #20
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    That zipped fun file opens fine but looking at the fun file I can't see any reason why it shouldn't work.

    I've worked with Audacity before myself without any problem.

    Most likely the mass.edu server is sending out headers with a wrong mime type or it has some sort of protection that allows certain extensions to be accessed only from a specific domain or referrer. You might be able to solve it with a .htaccess file if it's an apache server and you are able to find out what's causing the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center