background preloader

Audio

Facebook Twitter

ActionScript sample: Sound channels. Working with the Microphone in AS3.0 | Flash for the Masses. For the code below, much code and concepts are from Adobe’s Working With Sound webpages, which is a great introductory resource to microphone audio. However, there is nothing about saving audio to a file. They delegate that to a media server, and seem to imply that there is no other way to save audio. Anyway, for simple screwing around with audio, the following class is a starter. All it does is send the audio from your mic to your speakers – your own public address system!

Setup: It requires a Flash MovieClip in the library that inherits this class. Like this: Like Loading... Tonfall - Tiny AS3 Audio Framework. Tonfall is an Actionscript framework to get you started in audio dsp programming within the Flashplayer(10+). Tonfall introduces only a vague design of an audio engine and is rather focussed on readability and simplicity than performance optimizations. Tonfall was initially written for the 'Audio Code Clash' workshop at 'Flash on the beach' conference 2010 in Brighton and used since then for several workshops.

Features process audio- and event-processors with proper time information polyphonic audio generation simple delay as a template for other effects various audio formats Wav AIFF RAW PCM (no header) Encoder/Decoder MIDI file parser WAV/AIFF/PCM to flash.media.Sound converter simple implementation of ToneMatrix A lot of examples to get started Examples (by various artists) Tonfall Googlecode.

As3wavsound - AS3WavSound (AWS) provides native support to play .wav files directly in Flash. Release v0.9: (finally) fixed playback of sample rates below 44khz! Release v1.0: will also support 8khz sample rate The Flex SDK does not natively support playing (embedded) .wav files. Thus far developers worked around this using ugly hacks (generating swf bytedata to trick the Flash Player).

Not anymore. AWS in the slimmest sense simply a copy of Adobe's Sound class. It mimics the Sound class but has support for playing back WAVE data. AWS currently needs Flash Player 10 or higher. AWS uses a Wav decoder that converts ByteData into mono / stereo, 44100 / 22050 / 11025 samplerate, 8 / 16 bitrate sample data, that is playable by the Sound class using the SampleDataEvent technique.

To add .wav files to your project you embed a .wav file as a ByteArray with mimetype 'application/octet-stream' and AWS will be able to decode this and playback this sound. more info It's that easy. PlayWithMozart. MicRecorder, a tiny microphone library. While working on the second chapter of "What can you do with bytes ? ", I came up with a tiny helper class for developers who need to record audio easily from the microphone in their applications.

Here is MicRecorder, which handles internally the ByteArray work with the Event.SAMPLE_DATA event dispatched by the Microphone object introduced in Flash Player 10.1 and the WAV packaging. The WAV encoder is bundled but any other encoder could be used in a near future Here is a little demo : To record audio from the Microphone in your application, just use those few lines : 02.var volume:Number = .5; 04.var wavEncoder:WaveEncoder = new WaveEncoder( volume ); 06.var recorder:MicRecorder = new MicRecorder( wavEncoder ); 08.recorder.record(); 10.recorder.stop(); When recording starts a RecordingEvent.RECORDING event is dispatched giving infos about time. 01.recorder.addEventListener(RecordingEvent.RECORDING, onRecording); 02.recorder.addEventListener(Event.COMPLETE, onRecordComplete); 4. player.play(); Recording and Manipulating Sound with Actionscript 3 » Things I Learned Today. Recently some friends of mine offered me the opportunity to port one of their casual games to Android.

I figured I would use air on Android as I’d been wanting to give it a whirl for a while. The app is called Talk like a Monster and basically records using the microphone and performs some transforms on the sound which it then plays back. I needed 2 things: Alter the pitch of the sound.Add an echo. So began to do some digging on how to do these things with Actionscript 3. Turns out there’s an awesome AS3\Alchemy library called Standing Wave that does exactly what I needed. So after a hard hour’s work researching and downloading I had all I needed to do the sound related functionality of the app. Setup the recorder Pretty straight forward here, just create an instance of the recorder and add a listener for when the recording is complete. Create Standing Wave Sample Next up we need to create Sample object from the ByteArray that MicRecorder generates which StandingWave can use. Lets Jam. Flash Developer Diary.