ActionScript 3.0 :: Listening For The End Of External Audio Files?
Aug 22, 2011
I have an event listener that is listening for the end of an eternal audio file. I want to move to the next page after an external audio file has completed playing: here is the code I have so far:
This seems to work intermittently. Sometimes it will, and other times it won't. Is there anything wrong with my code or theory. Is there a better way to do this that will yield more consistent results? Or do I need to import any Flash Events?
I would like to have an external file (actually, one of several randomly selected files, but I can handle that) play and loop but I have yet to understand how to do the latter. My code works great for playing the file through one time, but when playback completes, it's done. How do I loop the audio? Is there perhaps a listener that can wait for the file to finish playing, then call a function to play the sound again?
I need to merge two flv files, using PHP. I can't use exec method. I am wondering if is possible to cut some part of one flv file (audio tag) and paste to another and overwrite duration for output file. [URL]..file-length-using-pure-php but I do not know how can I get an audio tag from a flv file? How many audio tags a flv file has? Which tags should I overwrite in output file to be able to play audio from two merged files?
I've got a swf which uses AS 3 to load separate audio (mp3) and video (flv) files. The reason they're separate is because the audio is just background music while the video is navigatable. The video kinda goes along with the audio, but it's not imperative that the two sync perfectly. However, the audio always starts playing before enough of the video has loaded to begin streaming.I'm at a loss as to how to get the two to at least START at the same time.
If I publish using an Adobe Flash Media Encoder 2.5 or a normal client a netstream with codec NellyMoser at 8Khz, the audio stream is incomprehensible for a MAC OS or a Linux Adobe Player.Steps to reproduce:
1. Create a new Actionscript Project in Flex Builder, for example: AdobeBug.
2. Start a Flash Media Server 3.5 in localhost(rtmp://localhost/live).
3. Insert the following code in the Default Application file: AdobeBug.[code]
4. Compile and play the file. 5. Run the Adobe Flash Media Administration Console and play the stream named livestream using a Linux or a Mac OS system, but not a Windows system. This stream should be a Nellymoser audio at 8KHz.
Playback starts, but audio is unintelligible in Linux and Mac OS Adobe Flash player.Doesn't happen if I listen the stream using a Adobe Flash Player plugin or a Flash Media Administration Console for Windows systems.
I'm trying to get javascript to talk to flash, but I haven't been able to get it to work.I've gotten flash to talk to javascript, but not the other way around. It seems as thought flash isn't listening to the javascript, or I'm doing something wrongPart of the AS3 to initially call the js:
As titled, what is the way to record video/audio files using Flash Meida Server through rmtp, and allow users to access the recorded files through http?What I am trying to do, is to record a user's microphone's input and save it to the server.fterwards, I would like other users to be able to access the recorded files and mainuplating the audio data, by computeSpectrum(), to do some visualization of the audio. As I know computeSpectrum() cannot work on streaming files, so I think I need to access the recorded files using http instead of rmtp. Is that true?
i have an SWF file, which loads an external SWF... and the external SWF file is an image gallery that dynamically loads images..this is the code and it works to some degree...
my problem is that the external SWF file is added even though the images in it have not yet been all loaded.. this is because flash (probably) calculates the file size of the "raw" external SWF without realizing that it (the external SWF) will run another script on its own to load the images.. so technically, flash doesnt account for the images that will load...therefore the "COMPLETE" eventlistener only listens for the "raw" file size of the external SWF...
basically, i guess what im trying to say is, is there a way i can tell flash to "addChild" the external SWF only after it has run the script and loaded the external images as well...in case you're wondering, this is the code inside the external SWF that adds the images:
Code: Select allvar thumbnail:thumbnailSelector; var thumbXPosition:Number = 528.7; var xmlLoader:URLLoader = new URLLoader();
I'm making a flash movie and I have all of the audio timed out right in the .fla, but when i hold Ctrl+Enter to play the .swf, the audio is not timed right. I haven't expoted the video yet so I'm hoping that the file will be fine when exported.In the file attached, (it is unfinished) the audio, "You talkin' to me?" should happen after the camera has already finished panning up to the man's head. Instead, the audio plays while the camera is panning upward.
I'm converting some old RealMedia audio-only files to use with the SWFOBJECT Flash player on the web. What's the best container/format to use for the files? I think AAC is probably the best format, but then can you play a *.aac file in the Flash player?
If i load an external mp3 file from either the internet or a user's computer, can i use the file's details (artist, album, etc).I don't know how to explain it, i think you can set the file's details in windows media player or winamp, and it gets stored with the file.
I'm working on making a pretty chunky game engine for games I plan on making, but I was wondering if you make external AS files unopenable such as .lib files, so that if I give it to a friend that wants to use it, he/she cannot change my code. Is there anyway to make external AS files unopenable? Also, obfuscation isn't an option for this problem as it only stops the people who hack the finished product, not stopping people who have access to the actual files.
I'm using flex 3. I've successfully played video and audio files by using following libraries:
flash.media.Video flash.media.Sound Live docs link. But the limitations are as follow: Video class can be used to play only flv file format. To play mp3 files I must use audio file.
So can I play most of the famous audio/video files by using single method?
Well by checking the file type we can some how achieve it. Then I should create a component for that.
So can any one suggest me such ready-made components? or is there any other alternatives to play audio/video files?
Recently I bought CS4 as I decided that I wanted to design and create a new website for hosting my music productions, I have used dreamweaver in the past so I am quite familiar with XML etc but I wanted to make something with a little more to it. After talking to quite a few people and reading into it all I found that this would be my best option. After thinking that it was all going to be quite nicely straight forward Im banging my head against a wall in trying to learn and understand Actionscript.
I have currently designed all of the pages, I have used a few tutorials on actionscript 3.0 and have the whole website is functioning, my pages, frames, labels and buttons are all functioning how they should on the timeline and there is around 14 pages..
The problem i've had for around 4 days now is getting all of my audio previewssnippets to work, i have around 20 of these and I need them to be spaced out on about 6 pages (frames) ; Each frame is a different release etc
In each frame, I have 8 buttons 4X play buttons next to each track and 4xStop next to that... play_btn, play_btn2, stop_btn2 and so on..
I've set it so that all I want to do is be able copy the code into the other frames and also the buttons (which are on a different layer) and then all I have to do is enter the filenames in the code below (Track1.mp3, Track2.mp3 etc)
So... it all works fine on my first frame of my release page.. The audio plays and stops for each track, no problems at all.
Now,, the problem happens when i copy the actionscript from my first release page(frame) to the next.. its about 25 duplicate functions, duplicate variables etc
Is there some kind of way I can put all of this into some kind of Class or Tag.. And this code only operates inside this frame and not in the next to cause the duplicate errors? I realise that I could Label every single variable, function and button differently covering all of the frames so that it dosn't cause the duplications to occur but, I am hoping there is some other way around this..
import flash.media.SoundMixer; //PLAY TRACK 1 var soundReq:URLRequest = new URLRequest("track1.mp3"); var sound:Sound = new Sound();
it is possible to mix different audio files and export them into an mp3 file for the end user to download to his computer.Actually, I know it can be done because they do it in various sites (aviary's myna , looplab , audiotool , remixgalaxy), I just need help on how to do it. I have the mixing part pretty much covered. My problem is with exporting the file to an mp3. I imagine that some external progamming language might be required, but I couldn't find an answer on Google... Php is my prefered language, but I'm willing to learn another one if it's not possible with PHP.
I've created a Flash slideshow where I load the narration audio MP3 file at the start of every slide with the typical code listed below. Of course this introduces a delay for the viewer at the start of every slide while its related MP3 file downloads.
Is there a way to download the MP3 files for future slides in the background while the first slide is playing in order to eliminate this delay for all slides except for the first one?
var soundReq:URLRequest = new URLRequest("audio/Slide_1.mp3"); var sound:Sound = new Sound(); var oneSoundChannel:SoundChannel = new SoundChannel();
I am bulding a slide show with syncronised audio I have aworking version which will load a series of jpgs names 1.jpg, 2.jpgand a series of mp3s (1.mp3 etc). The problm comes when I wanted toadd play and pause buttons.It works until on the second audio file if I click pause thenpay it goes back to audio file 1.mp3. Can't for the life of me findthe right code
I'm going to develop an online examination system. There are many audio files in the exam and it's time dependent. I'm looking for a way to predownload(cache) audio files so students won't waiting for file loading after examination starts. I want to use a single page to download files and this step is not include in the exam time.
Is it possible to play multiple sound files using a single sound object? (I've looked into this back when I was using Flash CS3, but I want to know if anything has changed.)
(I'm trying to make a playlist which will play music in the background of my SWF movie and then have a frame where users can change the song and the volume.)
I realize it is possible to play audio with Flash and HTML5 by passing a URL.
However, is it possible to get a reference to an audio file using a file browser (either with HTML5 or Flash), to then play this local file, again using either Flash or HTML5?
Of course, this should happen without the interference of a server. Since the file is already on the local system, it does not make sense to route it through a server only to receive the same file again.
I want to build an air app that takes input (for example a list of filenames to be generated) from the user and generates sound files with desired naming. The sound files should be an "empty/silence" sound (wav, aif or mp3). Is it possible the generate such a file? If not, can I use an existing sound and embed it into the app and have that as a source when generating the files? The purpose of this is to get a structure of files ready in the project that will be replaced by our Sound Director. This way, we can trigger all sounds before they are created.
I have a flash "hear from the experts" video in which multiple speakers discuss an issue. I have it set up so you can listen to each speaker one at a time, however, I don't know how to pause and play each speaker so if you wanted to pause it and return or pause it and start a different speaker, you could do that and then resume where you left off. It would be even cooler if I could add some sort of status bar that shows how far into the audio you are, and you could skip ahead. I uploaded the file in CS3 - I had to actually delete the MP3s that are triggered to play on each play button in order to make it small enough to upload, but if you look at the code you can see it there.
I've developed an application which uses a (dynamic) XML file to load in several files; a maximum of four MP3 files and a number of JPG files.When everything has finished loading, the user can press a "Play" button. The application could be described as a "mixer"; it's used to give online music lessons and to facilitate this, the sheet music is loaded (cut up into into several JPGs) which move horizontally on the screen like a marquee, while the music it represents begins playback. The music exists of several MP3s so that the user can mute (e.g.) the vocals or the drums, allowing him to focus on (e.g.) the guitar.
So what's going wrong, is that the audio files are not playing in sync. They are all pre-loaded so any delay between files shouldn't be sought in the files not being fully loaded yet. For initiating playback in the application, I'm using a simple function with a for loop in it, which sets each instance of my sound class to start playing at position 0 of its timeline (I've added in highlighting for all of the "code" blocks in my post, to keep everything easy to read through):
Code: function playSounds():void { for (var iCnt:Number = 0; iCnt < aSound.length; iCnt++) { // Start playback for each sound, at the time position set in the
[code]....
Seeing as this didn't work, I have no clue what I could give a shot next... so if anyone has any ideas or suggestions, it would be greatly appreciated! Something else I noticed, was that if I run the application on very fast PCs, the MP3s are almost always in sync, but the PC that I'm developing on isn't that sluggish either and they hardly ever run in sync on it - so it will form a problem for pretty much all of the people who will use the application.
need to create a player to stream audio files (mp3 and other audio extentions) in my website. To create this player I used flash cs3 and actionscript3.I found actionscript 2 is easyer to creat and get duration (mysound.duration) but in ac3 I can't get sound duration with this syntext : "mySound.duration"attention : In ActionScript3 BEFORE loading is completed , I need my audio file in player to show duration and displayed minute and second in the stage.I tried so many solutions in the internet but all of them provide sound duration AFTER loading is Completed (but I need sound duration BEFORE loading is Completed)attention : My audio files are multi bitrate rang exp.(24 kbs , 34kbs , 128kbs or higher).I am trying to get audio DURATION of audio "total bytes" but these solutions just are right for only 128kbs audios.
I'm having some trouble getting Haxe to play audio files in Flash 8.At the top of my hx file, I have:import flash.MovieClip;import flash.Sound;and, within the class itself, I preload a lot of image files along with the names of the audio files.The idea is to do a slideshow with audio content. Basically, display the first slide and play the audio associated with it.Then, once that audio is finished, move on to the next slide and next audio file. I have the slides fading in and out okay but when I tried to add sound, nothing comes out the speakers.The following code is what I'm doing - the sound file associated with audios[0] never starts playing and I'm at a loss as to why.
class Whatever { static var master : MovieClip; static var slides : Array<MovieClip>;