Streaming Audio In MX With XML File
Hi!
I have created a playlist where the user can play, stop, forward, and reverse audiotracks (+volumeslider and tracktitledisplay). It is all good when the audiosources are in the same folder as the .fla file (using a XML file to "send" tracktitle and source).
Now I'm looking for a way to stream these audiofiles. Anyone got a comment why it doesn't work to replace the sourcename (in the XML file) with an URL-source?
Any help on this would be very much appreciated...
XML:
<?xml version="1.0"?> <playlist> <track title="Beatiful" scr="http://www.appelbom/sound/Creed - Beautiful.mp3"/>
<track title="Gough" src="gough.mp3"/>
<track title="Tyalgum" src="tyalgum.mp3"/> </playlist>
ActionScript:
//Create arrays to store URL and title data for the mp3's playlist = new Array(); trackTitles = new Array();
//Import the XML data var xmlObject = new XML(); xmlObject.ignoreWhite = true; //Ignores any white spaces xmlObject.load("mp3.xml"); //This is where the XML data is loaded from an xmlObject file in the same directory xmlObject.onLoad = makePlaylist; //when the XML file has fully loaded, the function will start
//Function to create a list of url's and titles for mp3's function makePlaylist(){ for (var i=0; i<xmlObject.firstChild.childNodes.length; i++) { //The number of nodes in the XML determines how many tracks playList[i]=xmlObject.firstChild.childNodes[i].attributes.src; trackTitles[i]=xmlObject.firstChild.childNodes[i].attributes.title; } currentTrack = 0; //Display trackTitle in dynamic textField _root.trackTitle = trackTitles[currentTrack]; maxTracks = playList.length - 1; startStreaming(); trace("currentTrack " + currentTrack); trace("trackTitle = " + _root.trackTitle); trace("trackTitles [0] " + trackTitles[0]); }
//Function for streaming and looping the playlist function startStreaming() { _root.trackTitle = trackTitles[currentTrack]; mp3 = new Sound(); mp3.loadsound(playList[currentTrack], true);
slider.control._y = -50; slider.control.onEnterFrame = function() { mp3.setVolume(0-this._y); } slider.control.onPress = function() { startDrag(this, false, this._x, -100, this._x, 0); } slider.control.onRelease = function() { stopDrag(); }
mp3.onSoundComplete = function() {
currentTracks ++; if (currentTracks > maxTracks) { currentSong = 0 }
delete mp3; mp3 = new Sound(); mp3.loadSound(playList[currentTracks], true); } }
function playDirection(direction) { stopAllSounds(); if(direction == 1) { currentTrack++; } else { currentTrack--; }
if (currentTrack > maxTracks){ currentTrack = 0; } if (currentTrack < 0){ currentTrack = maxTracks; }
startStreaming(); }
stop();
ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 05-29-2004, 01:40 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Streaming AUDIO From .ASX File
Hi guys
Is there a way to stream audio from an .ASX file?
Bcoz here ate work are planing to have our WEBRADIO station to play at the company website as soon its loaded.
So i wonder if there's any way t make it on flash CS3
The player doest have to be showed to the user tho.
Tks in advance
Streaming Large Audio File
I have a large audio file that I want to synchronize with the animation of my movie. I know in order to best accomplish this, I should choose "stream" for the sync.
Should I just drag the file onto the stage on the keyframe that I want it to begin, or is there a smarter way of handling the audio when synchronizing?
Also, is there a better way of synchronizing the animation with the audio other than maticulously starting and stopping the playhead to find the particular points in the audio to sync with?
Streaming LLoooooonnngg Audio File
Hello,
I have this little interface that has a stop, pause, and play button to play some streaming audio. It also has a slider bar so that they can rewind or fast forward through the audio. Here's the problem... The audio is 1 hour long. I have a little ticker that counts how many minutes the audio has been played, so if they are in the middle, the ticker will read "30:00".
When the ticker reaches 21 minutes, it stops ticking and I can't slide the slider bar forward. However, the audio keeps playing. To stream audio you have to have as many frames in the timeline as there is in the audio. So I have something like 70,000 frames in my movie... maybe even more.
My thought is that the timeline isn't built for that many frames, so the streaming keeps going even if the timeline is out of space. My question is, is there any way to do this? I think I have to stream the audio to be able to keep the play and pause button as well as the slider. I borrowed this little interface and have attached it here for you to view. It calls a seperate sound file that is the entire audio stretched out across the timeline.
Also, How does Window's media player or any other default media player stream these long audio files? I would just put an mp3 out there, but then I don't want people to have to download players or not know which player they are using. Our audience gets confused pretty easily! 99% of them have the flash player installed, so that's why I want to use a swf to play these files. Any ideas?
Thanks!
Streaming Audio File Format
Hello folks,
I make a simple audio player, with play/pause button, and works great for straming a mp3 file but don“t work for a .wav file, the Flash support .wav type file for streaming?
thanks
How Can I Fade Out A Streaming Audio File?
Hi all,
I have a flash file that utilizes the "//Load Streaming mp3 behavior" ( found in Windows/Behaviors/Sound/Load mp3 Streaming File ) on a keyframe in the timeline.
That part works just fine. For now, I have a button that utilizes the "//stopAllSounds Behavior". That part works fine too.. however, I don't like the abrupt sound stoppage. I'd really like to have the streaming file fade out instead of stop suddenly. I don't care whether this happens via a button behavior or on a keyframe. Right now I'd like to use whichever is easiest because my ActionScripting knowledge is really poor.
Here's the link to the site I am building ( still rough ). The flame pit is the audio on/off switch.
http://www.abrohn.com/bombsquad/html/home.htm
Thanks for your help!
Streaming Audio Makes File Huge
Hi!
I'm a beginner at this so I'm mostly experimenting my way forward.
I am trying to build a small audio control center for my website.
I stumbeld on to two problems.
The first on is that since I import the music file, a mp3 file, the swf is about 3.5 MB large. That takes a while to load.
There has to be another way to implement the music file so that it doesn't have to be loaded when the swf loads but can load while streaming?
What I've done is simply import it to my movie and then added a function to my play button wich says: "sync = start"
Problem number two is the control part.
Say I have 5 songs (again the issue with swf size) and I want buttons for going though the playlist: Play, Stop, pervious, next.
I have managed to create play and stop but they are specific for one track: they start/stop one file.
Problem is: If I am listening to another track, how do I tell my stop button to stop that track? And how do I tell my start button to start say track 2 instead of track 1 wich is default.
And how do I navigate though the tracks with prev/next buttons since they have to be somewhat dynamic aswell: if at track 2 next would be track 3 but if at track 4 next is track 5?
Atm I have the swf at http://nordenfelt.thinkdot.de/winamp.php but it takes a while to load the file since the swf is so big
Happy with any help I can get with this =)
Would be a really nice feature on my site if I can get it to work.
Regards, Carl Nordenfelt
PS. Explain everything to me like I am a 3 years old child =) DS.
Video/audio Streaming With Same File And Interaction
Greetings,
Not a flash beginner, but not an expert either, but I do have a project that I would like to do this for. I was wondering if there were any tutorials or somebody could point me in the right direction for this.
What I would like to do is stream a movie file in flash, but also use the same source file, hopefully an mpg (perhaps an m4a), to just stream the audio. any way for flash to extract and play only the audio channel of the movie? I'd also like to use the same file for podcasting. I know how to do audio, but not video, and not in this particular way.
additionally, does anybody know if I can add interactivty to the flash, that is, display certain notes along with the broadcast within the flash file?
thanks for any direction, it is appreciated.
Sound Object Funkiness W/ A 2nd Streaming Audio File
Here's my issue... on frame 1 of my root timeline I have background music that is called from the library (works fine)by the following code:
code:
_root.bgMusic = new Sound();
_root.bgMusic.attachSound("winning_drive");
_root.bgMusic.start();
_root.bgMusic.onSoundComplete = function() {
_root.bgMusic.start();
};
I also have a narration that is on the actual timeline being streamed(works fine as well).
on frame 30 I have the following code to lower the volume of the background music ONLY, but it lowers both the narration and the background music... WHY!!!
code on frame 30:
code: _root.bgMusic.setVolume(40)
Flash Audio Player For Streaming Audio
I am working on our church's website and am trying to add mp3 sermons for our visitors to listen to. I have a player that I downloaded but is has some problems, for some reason it will play 2 files at the same time, sometimes it says file not found and I am not sure why. I do not have the FLA file just the SWF that was on the website for download so I can't make any changes. Can anyone tell me how to make a flash audio player with play, stop, pause, rewind and fast forward buttons. Or if anyone has a sample player that I could use for my church, I need it as small as possible and do not need a playlist. Any help would be great.
F8 - Streaming Audio From Streaming Server Help
Any one have any ideas why my streaming audio wont play? I trying to stream audio .mp3's from a streaming server. This way it is not a progressive download and cache.
But I can not seem to get the audio to play through my audio player. any thoughts? Or maybe someone can point me in the right direction?
thanks!
Streaming Audio
Please help me before I pull what little hair I have left out. Can somebody give me a simple step-by-step guide to installing streaming audio into a flash file. So far, I have only been able to set it up so that it has to completely download before it plays. That takes way too long.
I Have also read about re-compressing mp3 files to make them smaller, how can I do that. I am using Swish V2 to make the swf files and I use Sonic Foundry to make the mp3 files.
I know it can be done, even with a 20 minute speach, so how do I do it?????
Streaming Audio And Jpg
Trying to figure out if this can be done with Flash MX.
http://virtualmeeting.asco.org/vm200...me=general_top (click on Vogelzang near the bottom)
A little concerned about being able to stream both the video and audio, and then control those with next, back, play, and pause buttons also. Does anyone know if it is possible? any suggestions?
Thanks!
Audio Streaming
I'm a new flash mx user. Looking for tutorial or general info concerning adding streaming audio to a web site. Any info will be appreciated. MOON
Streaming Audio
I'm new at using Flash MX, and having trouble figuring out how to stream audio.Any help will be appreciated.
STREAMING AUDIO
Why when you STREAM an audio file does it sound worse than when you use the START or EVENT sync method? Right now I have a narration of a movie using the START method because I need the best possible audio, and if I used the STREAM method it gives the sound an echo.
Please any help would be appreciated.
Cheers
Streaming Audio
Is it possible to put an internet radio stream into a Flash movie? Like playing in the background of a page or something to that extenet.
Streaming Audio..
I am constructing a page for a Club night and have a 'top 5' chart which i want to add streaming audio to.
What is the best way of doing this?
importing a wav(stereo) and using the ADPCM compression?
or pre editing the wav into mono>convert it to mp3 then use the default setting?
i just dont know Help meeeeeeee
Streaming Audio
Greetings
can anyone give us a hand: I have no Idea how to stream audio.
so, If you can, tell me how (to stream audio).
Streaming Audio
Duh I know I should have figured this one out by now but...
Why does audio in Flash sound so much worse when it's streamed?
I have a voice over that has to be synced with my animation, so I have to set it to stream but the swf it sounds like crap.
I have it set to export ad mp3 with the hightest quality setting.
Audio Pop When Streaming
I have several audio track thgat need to be synced. Everything looks great except the last audio track pops when set to stream. It doesn't do this when it is set to event. All the other tracks sound fine. I've tried every setting. Anyone know what this is?
Thanx
Streaming Audio..
lets say I want to add a sound controller to play my mp3 song while it is streaming..how do I go about doing that ..like to press a play button play a streaming audio and to press a stop, stoping the streaming audio??
Streaming Audio
hey guys,
I was wondering if anyone could give me some help on streaming audio. I have a couple of button that when pressed i want an audio file to be played in say "windows media player, etc".not download the file but play streaming. How would i go about doing this.
thanks all
peter hubner
www.southwestern.edu/~hubnerp
Streaming Audio
www.driftlab.com
How did driftlab did his music player? The music is big and it start playing before loading all the music...
Streaming Audio
Hey Guys,
I need help with my Audio.
Im making a big movie for Newgrounds.com, but the audio seems to always go a little short when its uploaded but, I wanted to stream it, cause that seems to work. But, I dont know how to stream it over more then one scene.
Can anyone help? Or if not able to help me stream give me any ideas on how to keep the sync with the movie.
Streaming Audio
do you need a special server for streaming audio? does it work with geocities? cause im not sure what im doing wrong, so if you could give me a few tips or something about how to stream audio it would be good
Streaming Audio
I have built and mp3 player in Flash MX and have the following problem:
I'm using the loadSound method ie. tune.loadSound(tuneurl, true);
The tune loads and streams fine, but if the user wishes to stop it load a different tune, I can't find a way to stop the original one loading, causing the new tune to not stream properly due to band width limitations.
Hope somebody can help!...
DJM
Streaming Audio
I have built and mp3 player in Flash MX and have the following problem:
I'm using the loadSound method ie. tune.loadSound(tuneurl, true);
The mp3 loads and streams fine, but if the user wishes to stop it load a different tune, I can't find a way to stop the original one loading, causing the new tune to not stream properly due to band width limitations.
Hope somebody can help!...
DJM
Streaming Audio?
I know MX can stream video, I was wondering if it can do the same for audio mp3 or wma files.
I'm not at my workstation atm but in a hotel.. lol got my laptop but it can't handle the design software, so all I do is surf the web and play Yahoo! pool!
I'm just thinking about fooling around with a new website idea.
Thx in advance
Streaming Audio
Hi there, I'm currently streaming mp3's from another server with this code:
Code:
on (release){
streamer._visible = true;
stopAllSounds();
var gameSound = new Sound();
gameSound.onLoad = function (loadedOK) {
if(loadedOK) {
gameSound.start();
}
}
gameSound.loadSound("http://myserver/mymusic.mp3", false);
}
I set a mc named "streamer" to true to indicate an mp3 is streaming, but when a visitor got a phoneline modem connection (yes they excists :P) or smallband connection it takes a while before a 3mb mp3 is loaded, so what I'm lokking for is a loadbar thingy to indicate it's beeing loaded with % > when finished loading the streamer mc has to be vissible and when the mp3 is done the streamer mc has to be false...
How can I do this?
Streaming Audio
so i really like the "cleoplayer" found here on this site for a music player but there is one problem: By importing my *mp3s into the flash file it makes it REALLY huge and it will take forever to load. I want to just be able to stream the .mp3 file that is on my server through the player rather than embedding it within the player so it loads much faster. how can i do this? thanks
-sly
Streaming Audio?
I am trying to stream audio from an external swf which works fine but I would like to add a pause button. I do not know how to pause an external swf loaded through levels.
Here is the code I'm working with (please see http://www.flashkit.com/tutorials/Au...-881/index.php):
For the play button I have:
on (release) {
unloadMovieNum(66);
loadMovieNum("song1.swf", 66);
}
For the stop button I have:
on (release) {
unloadMovieNum(66);
}
Is there any way to pause the external .swf, I am fairly new to flash and I am completely stumped. Any help would be greatly appreciated. Thanks.
Streaming Audio Help?
Hi using mx here. is there a way to change streaming audio settings in flash. Im talking about the settings in the property window when you select streaming it automatically goes to 44khz and 16 kbps. I want to change the 16 kbps to something higher. thanks
Streaming Audio
Evenin' all, I need to stream one track of audio on a web page. Doesn't need to be anything fancy as I'm going to hide it. Just need it to stream!
Hope someone can help, many thanks!
Streaming Audio Help
hi,
ive been trying to get a minutes worth of music to stream from my server on the press of a button in my flash website. i cant get this to work, can anyone explain in the simplist terms how i do this as im not very good with action script.
also can i have the audio stop on the second press of the button?
THANKS!!!!?
AS3/CS3 Audio Streaming App Help
So, I've got most of it working, check it out at http://figmentmedia.ca/test.html. But I realized when I uploaded it that the loading bar (tan line across the bottom) didn't load with file. I may just have blazingly fast internet, and didn't notice the load.. but I doubt it. This to me seems strange, but might be simple to some of you. Here is my code:
Quote:
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.net.URLRequest;
var soundClip:Sound = new Sound(); //declaring variable 'clip'
var soundReq:URLRequest = new URLRequest("test1.mp3");//declaring var 'req' value is 'test1.mp3'
var soundContext:SoundLoaderContext = new SoundLoaderContext(8000, true);//declaring variable 'ctx' value is 8 seconds
var soundControl:SoundChannel = new SoundChannel();//controls the sound (stop/go)
var soundPosition:int = new int (soundControl.position);
var soundLength:int = new int (soundClip.length);
soundClip.load(soundReq, soundContext);//load 'req' with the value of 'ctx' (play at 8 seconds)
soundClip.addEventListener(Event.COMPLETE, onComplete);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onComplete(event:Event):void{
mc_control.btn_play.addEventListener(MouseEvent.CL ICK, playSound);
mc_control.btn_stop.addEventListener(MouseEvent.CL ICK, stopSound);
}
function playSound(event:MouseEvent):void{
soundControl.stop();
soundControl = soundClip.play(soundPosition);
mc_control.swapChildren(mc_control.btn_play, mc_control.btn_stop);
}
function stopSound(event:MouseEvent):void{
soundPosition = soundControl.position;
soundControl.stop();
mc_control.swapChildren(mc_control.btn_play, mc_control.btn_stop);
}
function onEnterFrame(ev:Event):void{
trace(soundControl.position/soundClip.length*100)
mc_position.x = 101+(soundControl.position/soundClip.length*294);//% of song played along a bar 294px long
mc_loaded.width = 297/(soundClip.bytesLoaded/soundClip.bytesTotal);//% of song loaded along a bar 297px long
}
The second last line there, thats the one giving me trouble.
Any Suggestions would be much appreciated
[CS3] Need Audio To Come After Streaming .flv
This should be an easy one...hopefully.
I have a series of movie clips and this question would apply to all of them.
After the movie clip is done playing, I need an audio clip to play. I am confused because the movie clip is streaming from a .flv that will be located on a disk - so when the clip is done, I don't believe the timeline where the mc is located will know to go on and play the following audio. Can someone please help? This is basically the last hurdle I have for a major project I am finishing and I don't know how to fix it. Thanks.
TDP
Streaming Audio
Hey,
Im wondering if its possible to have mp3's or midi files on on a webserver and for flash to access them, then start streaming them... stupid question i guess because im 90% sure you can do it i just cant figure out how.
Could someone point me in the right direction or possibly give me a tutorial upon how i can do this
Streaming Audio...
Hi my friend is a music producer and I am making a flash site for him. The problem I am running into is how would I go about Streaming his music so people could preview it before they buy? I went to one site www.kingsmenproductions.com and thats the style he wants but I do not want to embed all of the music files. It would take the site forever to load up. So I was thinking streaming with XML but I am not sure exactly how to do that? Any suggestions???
thanks,
josh-
Streaming Mp3 Audio
Hi, I've set up a streaming mp3 audio player. It works great, except that it plays correctly until it is done buffering, then starts from the beginning and plays all the way through again. Is there any way to make it so this doesn't happen, so that it plays all the way through just once?
Thank you!
Dan
Code:
var musicPlays:Boolean = false;
var loopTune:Sound = new Sound();
loopTune.onLoad = function(success:Boolean) {
if (success) {
loopTune.start(0, 999);
musicPlays = true;
_root.musicPlayer.gotoAndStop("playing");
}
};
songurl = _level0.song;
loopTune.loadSound(songurl, true);
musicPlayer.playPlay.onPress = function():Void {
if (musicPlays == false) {
this._parent.gotoAndStop("playing");
loopTune.start(0, 999);
musicPlays = true;
}
};
musicPlayer.stopStop.onPress = function():Void {
if (musicPlays) {
this._parent.gotoAndStop("stopped");
loopTune.stop();
musicPlays = false;
}
};
Audio Streaming
Greetings all,
How can I share audio samples (say read from the soundcard's microphone by flashplayer) with other applications?
Alternatively can I call functions from DLL or .o libraries using actionscript?
Streaming Audio
I am currently streaming an mp3 from my server to the flash page. Multiple sound files need to be sent after the creation of the flash window in the browser.
Is it possible to stream raw 16 bit 8khz mono PCM files?
I know this seem strange but my program creates them this way and it would save having to convert them. They are only small files so compression is not a massive issue.
Anyone know?
Streaming Audio?
Another Question, sorry for any inconvienience but I am wondering if there is anyway you can stream live audio through flash.
for example: is there a way to set up a central swf for a radio station and have them stream their music through computers?
sorry if it is confusing i cant really explain it.
just is there a way to use flash to listen to a radio station channel through your computer. i guess that is the easiest way to explain it.
thank you.
Streaming Audio?
Looking for a way to stream mp3 files with Flash, just a small button, maybe just like a circular play button.
Maybe even a player that can be resized, or can expand with more mp3 files being added.
any ideas?
PHP Audio Streaming...
HI!
how can i develop a page such like http://www.soundrangers.com/category-re ... at_id=0055
when i mouse over(onClick) on play file it auomatically play that audio file.......
if there is any tutorail or script, please let me know that.........
thanks in advance...
Streaming Audio
I'm placing streaming audio to play in the background of a webpage. I don't want the audio to be choppy so I was wondering if there are any recommened bit rate and sample rate audio settings for web audio. I haven't been able to find any online....
Streaming Audio
ok i have uploaded some songs now what i wanna do is stream them threw flash 5 how would i do that?
Audio Streaming
I recently create an audio player. The audio player works great, but when it loads I have to wait until it downloads the whole audio player and audio clip before it plays. How do i make it load the audio player and while it downloads enough of the audio clip, play the audio instead waiting to download the whole thing. The way the audio player works is that the audio is import into the audio player from the library. How do i go about of streaming it?
csound = new Sound(_parent.audioclip);
csound.attachSound("sc_ac");
csound.start();
How do i stream the audio player from here?
|