ActionScript 3.0 :: Sound Extract - ByteArray To Decibel?

Jun 29, 2010

When I extract the bytearray of a sound file I get the raw audio data. Is it possible from that raw audio data to get the decibels?

View 3 Replies


Similar Posts:


ActionScript 3.0 :: WAV File - New Sound.extract() Function To Get Two Seconds Of A Sound Into A ByteArray

Nov 11, 2009

I'm having some trouble getting the following code to work - trying to use the new Sound.extract() function to get two seconds of a Sound into a ByteArray, and then create a new bytearray with a WAV header, and then output the file. The resulting 'test.wav' file sounds very wrong although slightly recognisable? I think I may have some of the WAV header settings may be wrong but I'm not quite sure what's the matter and after a long time scratching

[Code]...

View 5 Replies

Flash :: Sound Extract To Bytearray - Progress Handler?

Mar 17, 2011

I'm using the following to extract the sound data from a sound object and store this in a byte array.

I require that the entire mp3 be loaded into the bytearray before advancing and the below works fine for this purpose however flash temporarily hangs while it extracts this data (2.4mb mp3)

Is there a way i can stop it from hanging i.e. use an eventlistener to check the progress of the extract process?

[Code]...

View 2 Replies

Actionscript 3 :: Alchemy ByteArray Float Conversion From Sound Extract?

Apr 6, 2011

I'm trying to do something simple: send a byteArray to a C library, fill up a buffer and read the memory, but I think I have float conversion problems.

Here is what I do in AS:
var memory:ByteArray = gstate.ds;
// get sound
var soundBytes:ByteArray = new ByteArray();
_source.extract(soundBytes, 4096);

[Code]...

View 1 Replies

Actionscript 3 :: Introduce A Sound From The Library To A ByteArray (and Then Play That ByteArray)?

Feb 16, 2011

I am working on a game, made with Flash (using AS3) The game has a fast ball and when this ball hits an object it has to make a sound... but the sound starts with delay (so the ball is far away when the sound is played).This sound is edited by me and it hasn't got any silences at the beginning.The method i'm currently using is the simplest one:

public var sonidoPuntos1:sonidopunto1 = new sonidopunto1()

and then...

sonidoPuntos1.play()

I am trying to introduce the file into a ByteArray and then playing it from there...

View 2 Replies

Actionscript 3 :: Sound.extract Method Empties Sound Object Data

May 20, 2011

I am using the following to extract the byte info from a sound object - however if I go back to the same sound object and run this again, The byteArray has no bytes available.

var data:ByteArray = new ByteArray;
sound.extract(data,sound.length*44.1);
data.position = 0;
return data;

Is this the correct behavior? Is there not a way to do this multiple times on the same sound object?

View 3 Replies

Flash :: Playing Sound From Data Acquired From Sound.extract()?

Aug 1, 2011

I'm trying to play a sound using a technique found here (play the sound by sampling raw sound data gathered from the original with extract()), with the difference that the mp3 sound is embedded in the swf, not loaded externally. This is my code:

var soundBytes:ByteArray = new ByteArray();
var mp3sound:Sound = Sound(new Sound1_design()); // this is the embedded sound
mp3sound.extract(soundBytes, int.MAX_VALUE);

[Code]....

This works, in a way, except that the resulting sound is distorted (it has a kind of a metallic ring).

View 1 Replies

Flash :: Extract Sound From A Fla?

Jan 30, 2010

There is an .fla file that has a sound wave in it's library. However I do not have this sound wave saved on my computer so I can not edit or open this sound in another application. I was wanting to know if its possible to extract this *.wav file from out of the fla library? I did some research and they said to goto export movie and export it as an *.wav file. However I tried this it exported the whole fla file as one big *.wav dud. I tried to play it and nothing happened which makes sense.

View 4 Replies

ActionScript 3.0 :: Sound.extract() To WAV File?

Oct 15, 2010

converting a Sound object into a WAV file (bytearray). The main issue is I need its samples to be 16-bit per channel, and Sound.extract() returns 32-bit floats (per channel).After that I was going to add the wav headers and write the bytearray to disc. I'm widely surprised for not having found an example of it working on the web

View 9 Replies

ActionScript 3.0 :: Sound.extract In Flex Builder?

Dec 26, 2009

I'm using Flex builder to work on my flash project, and after reading this article about manipulating sounds using Sound.extract() I got very excited.So I wanted to get using it, but as far as Flex builder is concerned, the sound class doesn't seem to have an extract function, and causes an error if I try.I've downloaded the latest milestone SDK (3.5) and updated the eclipse system (I'm on a mac), but it still doesn't want to recognise the existence of Sound.extract(), even though the function appears withi

View 1 Replies

ActionScript 3.0 :: Load Mp4 With Flvplayback Extract Sound?

Jun 7, 2011

i would like a method to do this.I have a video mp4 play with flvplayback with soundi would like to play sychro mp3 music file with videoBut video have an audio and i would like to keep my audio too.Then how can mix the audio of my mp4 with audio of my mp3?

View 6 Replies

Flash - Flex Sound Extract And Save Mp3?

Aug 15, 2011

I'm trying to rig up a basic mp3 cutter in Flash (using the Flex framework)I have gotten so far:

var ba:ByteArray=new ByteArray();
sound.extract(ba, playEnd - playStart, playStart);

This extracts the relevant bytes from the sound object and stores them in ba Then, I do this:

saveFile=new FileReference();
saveFile.save(ba, sound.id3.artist + " - " + sound.id3.songName + ".mp3");

The file saves properly, but it can not be played (Players say it is corrupted) how I can create a valid mp3 file from the byteArray obtained after the extraction?

View 2 Replies

ActionScript 3.0 :: Sound.extract() On Streaming Audio?

Sep 8, 2010

I'm picking up Flash and AS3 after working with AS1 a few years back. My first project is a mp3 player that is able to take an mp3 file, a start loop point, and an end loop point to loop the mp3 without any gaps or breaks in the sound.

blog.andre-michelle.com/2010/playback-mp3-loop-gapless

I found this page that got me started, and went off of that code. The resulting player works perfectly except for one fatal flaw. As far as I know, the mp3 file must be fully loaded to be able to use the Sound.extract method on it, this can take a while when the files are 3-4 MB, especially on slow connections. I want to be able to have the audio start playing as soon as the mp3 file begins loading.Is there any way to use the Sound.extract method on a streaming audio file that has not fully loaded yet?

View 6 Replies

Actionscript 3.0 :: Music Visualization With Sound.extract()?

Mar 19, 2009

I'm trying to match the behavior of SoundMixer.computeSpectrum() by using the new Sound.extract() method, so that I can draw music visualizations for separate Sound objects at once. As you know, computeSpectrum() samples the currently playing audio and copies it to a ByteArray. Sound.extract(), on the other hand, copies as much of the Sound as you want to the ByteArray, and does not require the Sound to be playing at the time.

With the Sound data extracted to a ByteArray, I know have about twenty-six thousand floating-point values representing the waveform, from start to finish. However, I'm only interested in about thirty-two of them at a time- the last thirty-two that were played. How do I determine where in the ByteArray that would be?

View 2 Replies

Actionscript 3.0 :: Music Visualization With Sound.extract()

Jun 30, 2009

I'm trying to match the behavior of SoundMixer.computeSpectrum() by using the new Sound.extract() method, so that I can draw music visualizations for separate Sound objects at once. As you know, computeSpectrum() samples the currently playing audio and copies it to a ByteArray. Sound.extract(), on the other hand, copies as much of the Sound as you want to the ByteArray, and does not require the Sound to be playing at the time.

With the Sound data extracted to a ByteArray, I know have about twenty-six thousand floating-point values representing the waveform, from start to finish. However, I'm only interested in about thirty-two of them at a time the last thirty-two that were played. How do I determine where in the ByteArray that would be?

View 5 Replies

.net :: Programmatically Extract The Sound Portion Of A Flash SWF File?

Mar 12, 2010

Do any libraries exist with this functionality?

View 2 Replies

AS3 :: Flash - Sound.extract() - Create A Visual Waveform For An MP3

May 29, 2011

I'm trying to create a visual waveform for an MP3. The code I've included is called on successful load of the MP3. I intend to extract just a few important samples from the sound to create the waveform, rather than extract the entire sound into a bytearray. Even on a good machine, extracting an entire song can cause flash to freeze up for 3-5 seconds (or longer!). For my purposes, this isn't feasible.

Unfortunately, the code I've got below is failing to produce any numbers. If I extract the entire song it functions, but extraction of just the key points is giving me nothing. Does performing an extract make the remainder of the sound object invalid for future extracts? If so, is there some way around this that won't freeze flash for an extended period of time during the extract? Some important variables from the rest of the code:

[Code]...

View 2 Replies

Flash :: AS3 Using Sound.extract In A Loop To Analyse A Soundfile?

Aug 27, 2011

From this AS3 code I expect 500 lines of trace outputs that contain "2048". But instead I get only some lines containing "2048". The rest of the traces print a "0" which shows me that the extract() method did not return any data.

Why is this the case? I would like to iterate through the soundfile with a specific amount of steps to extract 2048 bytes of the sound at the respective position. Extracting the entire soundfile at once would freeze the flashplayer for seconds and is therefore not a good solution for me.This behaviour can be found as long steps is smaller than samplesInSound/2048.The closer it comes to that value, the more lines with a "0" are printed compared to those with a 2048 in it.

var sound:Sound = new Sound();
sound.load(new URLRequest("soundfile.mp3"));
sound.addEventListener(Event.COMPLETE, soundLoaded);[code].....

I had the idea that the extracted part of the soundfile is cut out of the rest of the soundfile after extracting it (like at Actionscript 3 - Sound.extract method empties sound object data), so I tried out another for loop:

for(var i=0; i<samplesInSound - steps * 2048; i += Math.floor(samplesInSound/steps) - 2048) but this didn't work out either.

View 1 Replies

ActionScript 3.0 :: [FP10] : Sound.extract And Saving Mp3 File?

Jan 29, 2009

how to convert bytearray of samples from Sound.extract to bytearray of mp3 file? I want to save editied mp3 to user's local disk.

View 0 Replies

ActionScript 3.0 :: Extract Sound From A Video For Pitch Shifting?

Jan 4, 2011

any thoughts on how to extract the audio from a movie? Pitch shifting is do-able to this article:But the code uses the Sound class.I've NO idea how to go about extracting the audio from a movie/FLVPlayback

View 5 Replies

ActionScript 3.0 :: Turn A ByteArray Into A Sound?

Feb 3, 2010

I have a sound-file (.wav, could be any format) saved in a ByteArray. How can I play it as a Sound? I've heard it should work with SoundChannels and stuff, but I don't know how...

View 9 Replies

ActionScript 3.0 :: Playing Sound From Bytearray?

Feb 10, 2010

I'm trying to write a simple sound recorder and am having trouble playing sound stored by using the sampledataevent trigger. My code is as follows:

Code:
import flash.display.Sprite;
import flash.media.Microphone;
import flash.events.*;

[Code].....

When the playFoReal function (sorry for the name!) is called no sound plays. I know my as is bad but I only started learning recently and really need to get this program working! There don't seem to be many examples to look at as I guess this technique is rather new.

View 0 Replies

ActionScript 3.0 :: Sound.extract() Method Undefined When Test The Movie

Mar 24, 2010

I have installed Flash CS4 upgrade successfully with Flash CS3 full. I have also installed Flash CS3 full and then CS4 upgrade, but it made no difference. I cannot test an example that uses sound.extract() method. When I test the movie, I get an error message stating "Call to a possibly undefined method extract through a reference with static type flash.media.Sound".

View 4 Replies

Audio :: Extract Sound Object To A Mono Byte Array In AS3?

Jan 18, 2012

I'm trying to prepend the byte array of a sound object to a captured microphone sound byte array.

It works, but the extracted sound object get pichted down and doubled in length. I guess this is because the byte array of the sound object is in stereo, while the mic byte array is in mono.

I have this:

sound.extract(myByteArray, extract);

myByteArray now contains the stereo data. How can I turn this to mono

UPDATE:

Here's a working solution:

existingByte.position = 0;
var mono : ByteArray = new ByteArray();
while(existingByte.bytesAvailable) {

[Coe]....

View 1 Replies

Flex :: Raw Sound ByteArray To Float Array

Mar 4, 2010

I'm trying to convert the byteArray of a Sound Object to an array with floats. The Sound Object plays back fine & at full length, but the float Array i get from it is cut off (but sounds correct), so i must be doing something wrong in the conversion:[code]The top two channels are the original Sound Object.The lower two is the float Array Data. I aligned them so you can see that the beginning is cut off and obviously the length is incorrect.

View 1 Replies

ActionScript 3.0 :: Record And Playback Sound To ByteArray In Flash?

Mar 15, 2010

doing sound recording and playback in flash. I found this code from a tutorial and converted it to a flash document. From my traces, the record functions seem to be called. But when I try to play back the data, it tells me that the byteArray is empty. I've tested and I know that my microphone is working.

When I trace the size of the ByteArray, it returns 0;
 
So why does no data get recorded into the ByteArray?
 
output:
Recording
Stopped recording
Start Playing
Play Data - NO DATA

[Code]....

View 10 Replies

Actionscript 3 :: Get The Bytearray From The Image And Sound From The Client's Webcam?

Dec 13, 2010

i try to get a bytearray from a webcam. i can get the image of the webcam, copy it to bitmapdata and get the bytearray. but is it possible to get the bytearray from the image and sound from the client's webcam?

View 2 Replies

ActionScript 3.0 :: Play MP3 Sound From Buffer (ByteArray / Stream)?

Oct 25, 2009

I have a buffer with MP3 data (If I would save this buffer and call it buffer.mp3 it would play, but in this situation I should not save it to file system). I have to play it, but I can not, what shall I do? I tried the next code to play that buffrer(ByteArrayStream) (I get MP3 data from server the method of getting data works fine (tested on text int's etc) I call the returned ByteArray readResponse because I have some seading method and It is it's response).

[Code]....

View 5 Replies

ActionScript 3.0 :: Playing Sound In Bytearray To Kill Latency?

Oct 17, 2011

if i will load my mp3 to bytearray and then play the bytearray it will beat the latency we have in playing sounds normally?

View 1 Replies

ActionScript 3.0 :: Length Of Sound Recorded In Bytearray In Seconds

Jan 30, 2012

I'm trying to build a play back progress bar for an audio recorded from the users microphone. It works okay but when I play back I can't figure out how long the audio is so I can calculate percent played for animating a progress bar. Most of these snippets can be found in LiveDocs and online examples from bytearray.org. Audio is stored in the bytearray and the sound is played back in a sound channel.

[Code]...

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved