Array

Playing Back Audio

Must Read

Network Marketing Success – Make it Black Friday Every Day

The day after Thanksgiving in the US signals the beginning of the end - the mad shopping frenzy that...

3DTV/3DV IPTV Transmission Approaches

IPTV services enable advanced content viewing and navigation by consumers; the technology is rapidly emerging and becoming commercially available....

California DUI Penalties

The number of live DUI accidents is increasing with alarming rate in the state of California. To prevent such...

Choosing Home Equity Line of Credit

When you need money to pay for emergency bills, finance college education, consolidate debts, or for daily expenses, applying...

Private Student Loan Or Federal Student Loan – The Choice is Yours

Federal Student LoansLoans granted are based on the credit score of the borrower. The interest rates are fixed and...

2 Options To Get The Best Home Mortgage Packages

Getting the best home mortgage package, can make all the difference in your results, and this is an important...
Admin
test

Create a sound object and a listener to read the samples stored in ByteArray. You must set the position on the first bytes to rewind to the beginning of the recording.

Audio data is made of samples; 8,192 samples is the maximum amount of data that can be written to a sound at one time. If you try to play more samples, you will get a runtime error. If you provide fewer than 2,048 samples, the application will assume the sound reached its end and will stop:

import flash.media.Sound;
if (bytes.length > 0) {
bytes.position = 0;
var sound:Sound = new Sound();
sound.addEventListener(SampleDataEvent.SAMPLE_DATA, playback);
sound.play();
}
function playback(event:SampleDataEvent):void {
var sample:Number;
for (var i:int = 0; i < 8192; i++) {
if (bytes.bytesAvailable > 0) {
sample = bytes.readFloat();
event.data.writeFloat(sample); // channel left
event.data.writeFloat(sample); // channel right
}
}
}

Note that even though the microphone is monophonic in Flash, sound data needs to be written to both left and right output channels. If you don’t do this, the recording playback will be twice the speed at which it was recorded because two samples will run in one stereo sample of the sound object.

 

Previous articleRecording Audio
Next articleSaving a Recording

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest News

Digital Marketing for Beginners

Digital marketing for starter, Let to basic learning about connecting with your audience in the right place...

What are 7 things poor people do that the rich don’t?

1. poor people watch TV in which people read books how many hours you spend in front of the TV and when...

Top 18 best small business ideas for beginners starting

A small business can be frightening and requires plenty of careful planning there are many small business ideas which can be beneficial...

Summer that makes you happy

We saw were already here I've been thinking about some of the things. I used to do with my husband even though...

4 Point to helpful tips specifically for caregivers

What you need to take a vacation. I know it sounds impossible creative and try to make it work for you almost...

More Articles Like This