Add wav file in flash using as3
i want to add wav file to flash using as3 externally or
internally..............
If you look thru the Flash help files for adding sounds you
will find the options you have and don't have.
If you have already tried something and it is not working,
then provide details of your situation.
Similar Messages
-
How to open an .exe file in flash using AS3.0?
hi all
Iam trying to open an notepad.exe file, when I click a button in flash file. I tryed navigateToURL methoad, it is getting but it is showing some alert with
" save - run - cancel " options, when I click run it will open the notepad. But my requirement is it will not show any alert messages it should open the notepad directly. So, pls help me it is posible in flash with AS3.0 or not. If not, pls tell me is there any alternative for the same.
thanks in advance
Santhosh .Mhello..
i just made a labview .exe file..i do it by application builder..
It shows error.. missing of file path of an Icon.. it is in NI Library file..
Why it is not taking the path from there...
it also showing error that.it may be due to the moving or deleting the File..
The program is running good before making buid..
Please suggest a Solution to debugg this problem soon..
TIJU
Regards
Tiju Thomas -
Can I load ms word file in flash using JSFL?
What I want to do is,
Load a .doc file in flash using jsfl
Read it and save its data in xml
Is it possible?If you have a problem with Word, ask Microsoft. But I suspect you only came here to post your spam link!
-
Hi,
I am creating an iPad app using AS3. The app contains three sections.
One of those sections (chocolate sources)contains Dynamic Photo Gallery using XML. The photos, thumbnails, and text in this section are loaded from XML.
I faced may issue when I tried to run this app:
The gallery photos didn't show up
The thumbnails (buttons to navigate the photo gallery) didn't show up at all. (The thumbnails should show up under the photo gallery box.)
The text doesn't show up (the text should be in every photo as describtion)
I want to include Swipe in the photo gallery, how can I do that?
When I click on "Chocolate Sources" button, the photo gallery appears in every section, here are print screens describe what I mean:
The photo gallery covers the home screen too.
Here is my XML:
<?xml version="1.0" encoding="utf-8"?>
<sources>
<section>
<details>
Cocoa tree exists in the tropics area, such as Central and South America.
</details>
<image>
<url>coca1.jpg</url>
</image>
</section>
<section>
<details>
Cocoa is supplied in many countries such as Indonesia, Ghana, Brazil, Ecuador and Cameroon.
</details>
<image>
<url>coca2.jpg</url>
</image>
</section>
<section>
<details>
Dark chocolate helps to relax and reduce the stress and blood pressure because it has antioxidants elements, which helps in vasodilatory process.
</details>
<image>
<url>coca3.jpg</url>
</image>
</section>
<section>
<details>
Chocolate provides energy and hyperactive sometimes because it contains high level of caffeine and sugar.
</details>
<image>
<url>coca4.jpg</url>
</image>
</section>
<section>
<details>
Chocolate could be mixed with many different flavors, such as mint, strawberry, orange, banana, vanilla, hazelnut, almond, coconut, and etc.
</details>
<image>
<url>coca5.jpg</url>
</image>
</section>
<section>
<details>
Chocolate is expressing of well hospitality and good time due to its lovely taste.
</details>
<image>
<url>coca6.jpg</url>
</image>
</section>
</sources>
And here is my Action Script for "Chocolate Sources" section:
stop();
function Choco1(evt:MouseEvent): void {
gotoAndStop('16');
choco_btn.addEventListener(MouseEvent.CLICK,Choco1);
function Souc1 (evt:MouseEvent): void {
gotoAndStop ('31');
souc_btn.addEventListener(MouseEvent.CLICK,Souc1);
function ShopIn1 (evt:MouseEvent):void {
gotoAndStop('46');
shops_btn.addEventListener(MouseEvent.CLICK,ShopIn1);
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.display.MovieClip;
import flash.display.Loader;
import fl.motion.MotionEvent;
import flash.events.MouseEvent;
import flash.sampler.NewObjectSample;
import flash.text.TextFormat;
var xmlLoader: URLLoader = new URLLoader (new URLRequest("sources.xml"));
xmlLoader.addEventListener(Event.COMPLETE, finishedXmlLoader);
var xmlFile:XML;
var xextend:int = 10;
var gal:galary = new galary ();
gal.x = 85;
gal.y = 165;
addChild(gal);
var txfe: TextField = new TextField ();
txfe.x = 25;
txfe.y = 45;
var tformat:TextFormat = new TextFormat ();
tformat.bold = true;
tformat.color = 0xFFFFFF;
tformat.size = "18";
tformat.font = "Arial";
txfe.defaultTextFormat = tformat;
addChild(txfe);
function finishedXmlLoader (e:Event): void{
xmlFile = new XML (xmlLoader.data);
var leng:int = xmlFile.image.length();
txfe.text = xmlFile.image.details[0];
for (var i:int = 0;i<leng;i++){
var b:thumbs = new thumbs ();
b.x = xextend;
b.y = 480;
b.buttonMode = true;
b.details = (i+1).toString();
addChild(b);
b.addEventListener(MouseEvent.MOUSE_OVER, theMosover);
b.addEventListener(MouseEvent.MOUSE_OUT, theMosout);
b.addEventListener(MouseEvent.CLICK, onMosClick);
var bloader:Loader = new Loader();
bloader.load(new URLRequest("thumbs/" + (i+1) + ".jpg"));
b.addChild(bloader);
xextend += b.width + 50;
var loader:Loader = new Loader ();
loader.load(new URLRequest ("pictures/coca1.jpg"));
gal.addChild(loader);
function theMosover(m:MotionEvent):void{
m.currentTarget.alpha = 0.5;
function theMosout (m:MouseEvent):void{
m.currentTarget.alpha = 1.0;
function onMosClick(m:MouseEvent):void{
var loader:Loader = new Loader();
loader.load(new URLRequest("pictures/" + m.currentTarget.details + ".jpg"));
gal.addChild(loader);
txfe.text = xmlFile.image.details[int(m.currentTarget.details) -1];
I need an urgent help to fix the errors and make this section work well.
thanks.try:
txfe.text = xmlFile.section[int(m.currentTarget.details) -1].details;
instead of
txfe.text = xmlFile.image.[int(m.currentTarget.details) -1];
and add your thumbs to gal, not the stage. when you're done with the gallery, remove gal. -
Playing a wav file (byte array) using JMF
Hi,
I want to play a wav file in form of a byte array using JMF. I have 2 classes, MyDataSource and MyPullBufferStream. MyDataSource class is inherited from PullStreamDataSource, and MyPullBufferStream is derived from PullBufferStream. When I run the following piece of code, I got an error saying "EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c9108b2, pid=3800, tid=1111". Any idea what might be the problem? Thanks.
File file = new File(filename);
byte[] data = FileUtils.readFileToByteArray(file);
MyDataSource ds = new MyDataSource(data);
ds.connect();
try
player = Manager.createPlayer(ds);
catch (NoPlayerException e)
e.printStackTrace();
if (player != null)
this.filename = filename;
JMFrame jmframe = new JMFrame(player, filename);
desktop.add(jmframe);
import java.io.IOException;
import javax.media.Time;
import javax.media.protocol.PullBufferDataSource;
import javax.media.protocol.PullBufferStream;
public class MyDataSource extends PullBufferDataSource
protected Object[] controls = new Object[0];
protected boolean started = false;
protected String contentType = "raw";
protected boolean connected = false;
protected Time duration = DURATION_UNKNOWN;
protected PullBufferStream[] streams = null;
protected PullBufferStream stream = null;
protected final byte[] data;
public MyDataSource(final byte[] data)
this.data = data;
public String getContentType()
if (!connected)
System.err.println("Error: DataSource not connected");
return null;
return contentType;
public void connect() throws IOException
if (connected)
return;
stream = new MyPullBufferStream(data);
streams = new MyPullBufferStream[1];
streams[0] = this.stream;
connected = true;
public void disconnect()
try
if (started)
stop();
catch (IOException e)
connected = false;
public void start() throws IOException
// we need to throw error if connect() has not been called
if (!connected)
throw new java.lang.Error(
"DataSource must be connected before it can be started");
if (started)
return;
started = true;
public void stop() throws IOException
if (!connected || !started)
return;
started = false;
public Object[] getControls()
return controls;
public Object getControl(String controlType)
try
Class cls = Class.forName(controlType);
Object cs[] = getControls();
for (int i = 0; i < cs.length; i++)
if (cls.isInstance(cs))
return cs[i];
return null;
catch (Exception e)
// no such controlType or such control
return null;
public Time getDuration()
return duration;
public PullBufferStream[] getStreams()
if (streams == null)
streams = new MyPullBufferStream[1];
stream = streams[0] = new MyPullBufferStream(data);
return streams;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.media.Buffer;
import javax.media.Control;
import javax.media.Format;
import javax.media.format.AudioFormat;
import javax.media.protocol.ContentDescriptor;
import javax.media.protocol.PullBufferStream;
public class MyPullBufferStream implements PullBufferStream
private static final int BLOCK_SIZE = 500;
protected final ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW);
protected AudioFormat audioFormat = new AudioFormat(AudioFormat.GSM_MS, 8000.0, 8, 1,
Format.NOT_SPECIFIED, AudioFormat.SIGNED, 8, Format.NOT_SPECIFIED,
Format.byteArray);
private int seqNo = 0;
private final byte[] data;
private final ByteArrayInputStream bais;
protected Control[] controls = new Control[0];
public MyPullBufferStream(final byte[] data)
this.data = data;
bais = new ByteArrayInputStream(data);
public Format getFormat()
return audioFormat;
public void read(Buffer buffer) throws IOException
synchronized (this)
Object outdata = buffer.getData();
if (outdata == null || !(outdata.getClass() == Format.byteArray)
|| ((byte[]) outdata).length < BLOCK_SIZE)
outdata = new byte[BLOCK_SIZE];
buffer.setData(outdata);
byte[] data = (byte[])buffer.getData();
int bytes = bais.read(data);
buffer.setData(data);
buffer.setFormat(audioFormat);
buffer.setTimeStamp(System.currentTimeMillis());
buffer.setSequenceNumber(seqNo);
buffer.setLength(BLOCK_SIZE);
buffer.setFlags(0);
buffer.setHeader(null);
seqNo++;
public boolean willReadBlock()
return bais.available() > 0;
public boolean endOfStream()
return willReadBlock();
public ContentDescriptor getContentDescriptor()
return cd;
public long getContentLength()
return (long)data.length;
public Object getControl(String controlType)
try
Class cls = Class.forName(controlType);
Object cs[] = getControls();
for (int i = 0; i < cs.length; i++)
if (cls.isInstance(cs[i]))
return cs[i];
return null;
catch (Exception e)
// no such controlType or such control
return null;
public Object[] getControls()
return controls;Here's some additional information. After making the following changes to MyPullBufferStream class, I can play a wav file with gsm-ms encoding with one issue: the wav file is played many times faster.
protected AudioFormat audioFormat = new AudioFormat(AudioFormat.GSM, 8000.0, 8, 1,
Format.NOT_SPECIFIED, AudioFormat.SIGNED, 8, Format.NOT_SPECIFIED,
Format.byteArray);
// put the entire byte array into the buffer in one shot instead of
// giving a portion of it multiple times
public void read(Buffer buffer) throws IOException
synchronized (this)
Object outdata = buffer.getData();
if (outdata == null || !(outdata.getClass() == Format.byteArray)
|| ((byte[]) outdata).length < BLOCK_SIZE)
outdata = new byte[BLOCK_SIZE];
buffer.setData(outdata);
buffer.setLength(this.data.length);
buffer.setOffset(0);
buffer.setFormat(audioFormat);
buffer.setData(this.data);
seqNo++;
} -
How to overwrite the xml file by flash using Php
Hi
i am creating getting data from the xml file ... and i am
doing some Alteration in the xml file by flash after that flash
producing the xml file i finished upto this process...
nw i neeed to overwrite the xml file.... using Php.....
can any one give me some idea ... to solve this issue
~~SKFlash Player cannot write XML files at all. but using
php+flash we could do it . -
Is it possible to import a wav file into flash that is 48MB?
If I can only crunch the file down by 90% then I'm still at a
huge amount of MB. What is a "reasonable" amount of MB's that can
be uploaded so it loads quickly enough for dial up folks?
I have a client with a 10 minute video. He has it saved in
MPG and WAV. In wav he just told me it's at 48MB.
Should I even bother with a file size this large?
Any advice out there??
LindaHi,
If you target audience will use a dial up connection, then
you should consider the SWF file size to be small, I do not know a
standard, but I guess not more than 200-300 k. And use a preloaded
in the first of it.
The large WAV files helps increasing the file size, but it is
not the only reason. You have to tell your client to consider the
size in the files he or she sends. And you can optimize your file
and idea storyboard to keep the size small. -
Play wav file on PDA using JMF
Hi all,
I need to play wav files on a PDA so I installed J9 on the PDA and downloaded either JMF crossplatform and JMF for windows (version jmf 2.1.1.e for both of them).
I included in the classpath the jmf.jar from JMF crossplatform and sound.jar from JMF for windows (the JMF crossplatform doesn't have the sound.jar and jmf.jar requires some classes contained in it).
When I run my testing application I have such an error:
Unable to handle format: LINEAR, 8000.0 Hz, 8-bit, Mono, Unsigned, 8000.0 frame rate, Framesize=8 bits
Failed to prefetch: com.sun.media.PlaybackEngine@287a287a
Error: Unable to prefetch com.sun.media.PlaybackEngine@287a287a
I have the same error playing wav files with different features (8 or 16KHz, 8 or 16 bits ).
Can anyone help me?
Any suggestion is welcome. Thanks in advance!
Message was edited by:
pirascrsnot really I have seen it. The only buyable version left is IBM j9. All the rest basically are sold to handset manufacturers.
Its hectic out there. I still cant play audio on J9 to build a simple tourist guide!!!!
javajoom is for wtk21 - hello its 2007.
Oh well lets toss pda's out of the window along with Microsoft's OS and use smart phone OS - or should I toss J2me and start on C# to be on the safe side???
Has anyone an answer? -
Importing WAV file with Flash Cue Points Premiere Pro CS6
I want to import a Japanese voice-over . WAV file which has Flash cue points marked in it so that I can clearly identify edit points on the video timeline when I import it into Premiere pro CS6.
Or is there another way of getting a voice-over artist to mark up audio so that I can clearly identify when certain words or phrases have been spoken? Trouble is, Japanese characters mean nothing to me! Usually this is not a problem with European languages like French and German, as I can easily mark up the script with a highlighter as I can follow the voice over on the supplied script, but Japanese characters mean nothing to me.
Please help.
Many thanks.Premiere has a function now where you can import a clip and drag onto a timeline and it will prompt you with a message about changing the timeline settings to match your clip, (or if there is no timeline it will automatically create one that matches your clip.) This is in CC of course so you might consider upgrading. They have fixed a lot of compatibility issues from CS6 to now. If you don't want to get all of CC for 60/month then you can at least shell out 20/month on premiere. It's worth it. They've made it where you don't have to worry about 99% of all video formats. They just work.
-
Trying to convert wav file to mp3 using itunes?
Is there not an easier way to convert a wav file to an mp3. I import my file or folder but it does not convert. I have had to manually ask it to create an aac or aca out of each import. shouldn't it convert audimatically when I import file or folder. It did on the last version before this new update. Please help.
FlusteredIf Garageband doesn't work, try Audacity.
-
How to add frames to timeline/ movieclip using AS3?
Is it possible to add frames to main timeline or inside a
movieclip by code written in AS3.Yes. Never use frames.
You cannot make a template from a frameset file. The best you
could do
would be to have a separate template for each individual
frame. That would
be unthinkably silly, though.
The decision to use or not use frames should be based on a)
your site's
needs, and b) your willingness to accept the potential
problems that frames
can create for you as developer and maintainer of the site
and for your
visitors as casual users of the site.
I am down on frames because I believe that they create many
more problems
than they solve.
Judging from the posts here, and the kinds of problems that
are described,
the kind of person most likely to elect to use frames is also
the kind of
person most likely ill-prepared fo solve the ensuing problems
when they
arise. If you feel a) that you understand the problems and b)
that you are
prepared to handle them when they occur, and c) that you have
a need to use
frames, then by all means use them.
As far as I know, the most comprehensive discussions of
frames and their
potential problems can be found on these two links -
http://apptools.com/rants/framesevil.php
http://www.tjkdesign.com/articles/frames/
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"j.carney1987" <[email protected]> wrote in
message
news:fsnm01$d2g$[email protected]..
> When you go to build a template with dreamweaver cs3 it
won't let you add
> any frames. Is there another way with out manually code
it in? -
Opening files from flash using navigateToURL
I am opening a series of slides from my swf using:
var fileUrl:String = "http://place" + locationstring + filename;
var request:URLRequest = new URLRequest (fileUrl);
navigateToURL (request);
This opens up my file fine but it gives the user the option to save or open the file.
Due to the nature of the files - often being replaced and updated, I wish to take away this option so that the document just opens.
Is this the right way to do this, and if so how is it done?
Thanks in advance.Thanks for reply.
Ah ok thats a shame...Is there another way to open files?
In the most part I will be opening a .ppsx (power point show)
an .exe
and maybe the odd excel and word docs. -
Getting Information from ID3 tags from streamed mp3 files in Flash CS4 AS3.0
Hi everyone:
I have spend my whole day trying to find a good way to access ID3 tags in AS3.0; but didn't find anything helpful.
In my project I am making a sound object and assigning it a URL:
Then I stream the sound into a sound channel:
var s:Sound = new Sound(new URLRequest('URL here"));
var sc:SoundChannel;
My problem:
I want to read the ID3 tag somehow and display the artist name or anything in the ID3 tag, onto the screen.
Complication:
I Have the URL change through user input, and naturally I want to update all the information with the new ID3 tags information.
var s:Sound = new Sound(new URLRequest('NEW URL here"));
Thank you for any help!I know I took it out because it didn't work. I had something like this:
var soundLoaderContext:SoundLoaderContext = new SoundLoaderContext();
soundLoaderContext.checkPolicyFile = true;
var music:Sound = new Sound(new URLRequest("URL #1 (from my server)"));
var sc:SoundChannel;//sound channel
var isPlaying:Boolean = false;//checks f music is playing or not
var pausePoint:Number = 0.00;//this variable is for the pause function
music.addEventListener(Event.ID3, id3Handler);
stop_btn.addEventListener(MouseEvent.CLICK, stopMusic);//stop function call
function stopMusic(e:Event):void//stop function
if(sc != null)//if music is playing
sc.stop();//stops the music from playing
isPlaying = false;//sets it to false(off)
playPause_mc.gotoAndStop(1);//modifies graphic item on stage
pausePoint = 0.00;//resets pause value
play_btn.addEventListener(MouseEvent.CLICK, playMusic);//pause / play function call
function playMusic(e:Event):void//pause / play function
if (isPlaying) {// if it is playing
pausePoint = sc.position;pausePoint get curreny value (position of song)
sc.stop();//stops the music from playing
isPlaying = false;//sets it to false(off)
playPause_mc.gotoAndStop(1);//modifies graphic item on stage
} else if (!isPlaying){// if it is not playing
sc = music.play(pausePoint);//starts the music from the pausePoint value.
isPlaying = true;//sets it to true(on)
playPause_mc.gotoAndStop(2);//modifies graphic item on stage
music2_btn.addEventListener(MouseEvent.CLICK, music2);//function call (if music is clicked)
function music2(e:Event):void{//this function stops current playing music and resets graphics, assigns a new URL and starts playing it.
if(isPlaying || pausePoint != 0)
sc.stop();
playPause_mc.gotoAndStop(1);
music = new Sound(new URLRequest("URL #2 (from my server)"));
music.addEventListener(Event.ID3, id3Handler);
sc = music.play();
isPlaying = true;
playPause_mc.gotoAndStop(2);
music1_btn.addEventListener(MouseEvent.CLICK, music1);
function music1(e:Event):void{//this function stops current playing music and resets graphics, assigns a new URL and starts playing it. just like above only a different song.
if(isPlaying || pausePoint != 0)
sc.stop();
playPause_mc.gotoAndStop(1);
music = new Sound(new URLRequest("URL #1 (from my server)"));
music.addEventListener(Event.ID3, id3Handler);
sc = music.play();
isPlaying = true;
playPause_mc.gotoAndStop(2);
function id3Handler(evt:Event):void {
var id3:ID3Info = evt.target.id3;
trace(id3.artist + ' - ' + id3.songName);
name_txt = id3.songName;
album_txt = id3.album;
artist_txt = id3.artist;
This is mostly just taking the exact code from the website I mentioned earlier.
When I run this it outputs the trace command 1 time and nothing more. Only the trace(trace(id3.artist + ' - ' + id3.songName);) gets triggered once.
No errors. No warning. Not working.
Thank you for helping me! -
Add JPEG files for data use?
Hello all:
I'm looking for a solution to a simple question. After I have created a slideshow in iMovie '09 and moved it to iDVD '09, can I add another "chapter" that has all of the photo JPEG's in it that will allow the user to upload them to their computer or print them somewhere? Essentially, I have created a project for a memorial of a loved one that has died - it came out beautiful. But now I want to also include her family's ability to copy the now scanned photos and do with them as they wish. I'm basically looking to avoid making a second data disk to include with the DVD I've created.
Any direction or assistance on this is greatly appreciated!John,
Thank you so much for your fast and accurate response. I did as you said (Advanced > Edit DVD-ROM Contents) and it worked great! I'm very excited to give this gift away and now it can include their scanned photos in JPEG format.
Happy Thanksgiving to you and yours! -
Streaming wav files once edited won't work in flash
I need some help with streaming wav files in flash. I can load a wav file and stream it ok using actionscript 3 into my fla file. However if I go to edit the wav and make it shorter the saved wav file will not play. I have used a trial version of soundbooth to see if I could somehow change the settings for the wav but I still cannot make it work. It will stream as an mp3 but I want the file to loop and need the file to be wav. I have attached the file. I have no problem when I upload the file into the fla file but that is not what I want to do.
Can anyone help me.
Cheers.Thanks for the input however I had already tried a variety of combinations. But I did go through it again.
The Flash Player supports 8-bit or 16-bit audio at sample rates of 5.512, 11.025, 22.05, or 44.1 kHz. I have tried all permutations of wav from 8 bit to 16bit and the all sampling rates from 11.025. The original file is attached at it was at 32000hz. Nothing I can do will make these play in flash once edited. I am using soundbooth howeve I have used audacity and wavepad. I have removed the metadata tags as that was suggested in one of the forums. I have attached the original files and the shortened file that I cannot get to work. I went into Soundbooth and went through all the preferences and checked the box where it asked for FLash compaticble at 16bit 44 hz etc. This is really frustrating. I know wav can be streamed.
Maybe you are looking for
-
Will the video tags in HTML 5 work inside premiere pro panel?
Hi all, I am working on a Premiere pro cc panel. We are using eclipse and extension builder 3 to create the html 5 panel. But the preview video option in our panel is not working. We have created the preview function using HTML 5 video tag eleme
-
Web Template - Report designer
Hi , Is it possible to call Report designed in report designer in Web template ? If so please do let us know Cheers Ram
-
Masked content height is counted!?
I'm building a new full-page flash site and I have a Flash Scrollbar setup to automatically enable itself when the page content exceeds the Stage.height. Pretty basic. The problem here is that I have some components of this website, such as a image g
-
Translate attributes of component-profile section
I've defined an attribute called welcomeMsg in the component-profile section of my portal application. I want to use this attribute to configure a welcome message which is shown at the iview. Further I want this attribute to provide a mechanism to tr
-
I right clicked the video in iTunes and hit convert to iPod format. It converted but the audio disappeared. Can anyone tell me why?