How to apply sound distortion in actionscript-3? - actionscript-3

Let's say the sound input is either an embedded mp3 file or the microphone.
Is there an example of how to make it sound demonic and creepy, or like a radio transmission from the battlefield in actionscript-3 dynamically on runtime.
Reference:
http://www.youtube.com/watch?v=JAY88WH0FcU

As far as I know, you simply can't with the microphone, unless you first send it to a server.
With an audio file (embedded or not), you can distort it by playing with its bytes (ref), but its not at all a trivial task (I'm not aware of any library for "easy" sound processing).

Related

AS3: Recording sound as they are output/played

I understand how to record microphone input in AS3 from this doc.
Is it possible to record sound exactly as they are being output/played?
The reason is I applied some sound transform (via the global SoundMixer) to sounds that are currently playing; and I also want to record this sound data while it is being played.
I just saw this question, to clarify, I am not trying to record just all sounds on the user's computer (which is not possible). My flash app has a Youtube player in it (via their AS3 API), and it's playing some sounds. I applied transforms using SoundMixer.soundTransform, and I want to record what's being played when the user is playing it.
Thanks in advance.
Just a passing suggestion.. on my desktop it seems ABLE to record sound into Flash from a different tab playing Youtube (HTML5).. I don't know how it's doing that!!
I allow microphone here.. (none actually plugged in, and speaker out has in-ear headphones)
http://code.tutsplus.com/tutorials/create-a-useful-audio-recorder-app-in-actionscript-3--active-5836
PS: Anyone trying this must reduce Windows volume since anything above 10-20% is distorted audio into the Flash app.
And this HTML5 youtube trailer was recorded fine into the Wav file produced by Flash app above
http://www.youtube.com/watch?v=MVt32qoyhi0
So after a quick search it seems my Realtek Audio is classed as a Full-Duplex soundcard and also within its own control panel I have an option called "Multi-streaming" which is enabled/ticked. I think Full-Duplex is enough to do this though. Try options within your soundcard's own settings software. Don't know about your end-users. Some hardware will do it, some wont, there is no all-round solution outside of AIR (which makes desktop apps out of your AS3 code).

as3 air convert sequence of bitmaps to flv

It's posible convert an image sequence (jpg, png) to .flv (or .mp4 instead), using AS3/AIR?
I'm developing an app. This app must record video on an Android tablet.
As the "CameraUI" class doesn't permit to put images/design over the camera capture, and I need to overlay branded design,
I'm trying to save a sequence of bitmaps using this Starling extension (Using this extension I can overlay desing and it's manage a good performance).
My idea is take the generated image sequence, convert it to video, and then to delete the original bitmap files.
Any idea?
Thanks.
Yes this is possible. FLV is an open format. Easiest way is to create raw flv. Otherwise you need to search for the proper compression (there are libraries online).
For the first one, there are a few very old posts, but I think the idea is the same. Few can be found here:
http://www.zeropointnine.com/blog/simpleflvwriteras-as3-class-to-create-flvs/
http://www.joristimmerman.be/wordpress/2008/12/18/flvrecorder-record-to-flv-using-air/
Try to search for 'flv recorder'. There are few out, even with compression and audio.

How to create play and pause in SWF Format?

I am beginner to Flash.
I am having a SWF Format, I have to keep that in my html page like a video. I need a play and pause button in that video.
Thank you.
SWF file is time line based, even if you convert a movie from AVI to SWF generally there is some sort of key frames.your converting program will offer the properties of this inside the software
Easier way to control a SWF movie would be to embed your FLV into the SWF, than add key frames manually. then you can control from a parent SWF with timeline control
If your just playing a movie file in flash , it may be better to use "net-stream" this will allow you to have also full control over the movie file using cue points, this has other advantages ....quicker loading times, as the whole file would not have to be downloaded first as it allows streaming / Buffering. Using cue points has the same ability as key frames.
so your pause and play button is dependent on how you implement your video

Embedded Sounds cut off early

I have a combined Flash Builder/Flash Pro project. Because of the hassles involving in maintaining sound assets on the timeline, my sounds are all embedded into Class files, like:
[Embed (source="/mp3/Welcome_01_V.mp3", mimeType="audio/mpeg")]
private static const WELCOME_1:Class;
These files are then referenced by the base Classes for the symbols that need them, embedded for Actionscript on Frame 10 (because the second frame label is on Frame 10 to give space for you to read the first one).
What I'm finding is that a few of these Sounds don't play all the way through, but the SoundChannel dispatches the "soundComplete" event, and its final position matches the Sound's length.
All sounds are converted from wav to mp3 at 44Hz / 16 kbps. I faked out the compiler to avoid a reference to Flex by including a dummy SoundAsset that extends Sound.
I don't know what other steps to take to debug this. Is there a way to figure out whether the problem is on the compile side or on the run side?
Updated
More things I have tried:
Looked at the Size report: The nonworking sounds were smaller in
their embedded form than the source mp3
Got rid of my own BitmapAsset and let Flash link in the Flex Framework and do whatever that does (definitely worse)
Dropped the encoding from 44 kHz to 22 kHz (no improvement or worse)
Dropped the bit rate to 8kbps (the lowest dbPowerAmp, the tool I use, supports). This usually helps somewhat, but I still usually use a word or two from the end of the file
Dropped both parameters in the encoding. This helped a few that just dropping the bit rate didn't, but not all files. Plus it sounds tinny.
Thanks!
For Flash audio, I recommend importing the sound assets into a FLA using wav files if you have the high quality source wavs. Otherwise, you can consider converting your mp3 into a wav as well. Then set the FLA export settings to the quality you want and Flash will convert your wavs into its own format at the quality you set with hopefully less issues.
Once you do that, you can export the sound symbol for actionscript in your library and set a class name just like how you would embed it.
One other trick I use is I have one FLA just for sound assets which can be used to store as big waves as I want. And when I export that, it becomes a small SWF file which I can then embed in my main application. That way, I never have Flash reconvert the wavs to the swf every single time I export the swf. Instead it just copies the swf data which is much faster as well.
[Embed(source="Audio/Sfx.swf", symbol="WELCOME_1_WAV")]
private static const WELCOME_1:Class;
If you are having audio cut off issues in Flash Pro, you may want to check your frame rate.
I had an issue with sounds cutting off (in Flash pro CC 2014). My issue turned out to be related to the frame rate being set to 25 rather than the default 24. I have been using 25 to resolve an issue unrelated to anything in this project, so my solution was to change the FPS to 24, which invoked the necessity to move all of the synchronized animations to re-align with the corresponding audio.
Why long(ish) audio tracks get cut off at the end when the frame rate is at 25 regardless of using proper keyframing is a mystery. This solved the symptoms however, so if you are having audio cut off issues in Flash Pro, you may want to check your frame rate.
My symptoms were specifically when an audio clip was particularly long, and deep into the time line.
What worked for me: I opened the audio files in an audio editor and added a few seconds of silence to the end.
Good luck! - J.Hall

Accurate sound input in Actionscript?

I want to create a swf or air app that takes an input and displays a graphic representation of it.
The graphic side is fine for the moment, but its always using an mp3 for example
var sound:Sound = new Sound (new URLRequest("myMP3.mp3"));
- i want it to be able to take a 'live' audio feed. How would I do that and is there a better way than using the microphone input?
thanks
dai2
Microphone input is probably the easiest way and using flash player 10.1 or AIR 2.0 you can do this. Take a look at http://www.adobe.com/devnet/air/flex/articles/using_mic_api.html
It's not as easy as using SoundMixer.computeSpectrum but offers the possibility (+ more). You'll for instance most likely want to run the data through FFT to use in visualization