Solved

gapless sync and playback  audio as3

Posted on 2013-05-19
1
352 Views
Last Modified: 2013-06-12
I have 37 sounds that are all the same bpm.  I would like them to sync with each other when their button is clicked to be played.  
Currently I sync the sounds to a background sound using the sound_complete listener. It works but
the sound become slightly out of sync becuse I am relying on the flash sound_complete event listener.   If I just loop them play(0,9999); they loop great but I cannot sync them with each other.   Any solutions to this?

var sndSync:Sound = new b3();
var chnSync:SoundChannel=sndSync.play();
var myVolume003:Number=0; 
    var myTransform003:SoundTransform=new SoundTransform(myVolume003); 
        chnSync.soundTransform=myTransform003; 
		
chnSync.addEventListener(Event.SOUND_COMPLETE, loopSoundf);
function loopSoundf(e:Event):void{
	   
		chnSync = sndSync.play();
		chnSync.addEventListener(Event.SOUND_COMPLETE, loopSoundf);
		chnSync.soundTransform=myTransform003; 
		  
	}
	
	syncer.addEventListener(MouseEvent.MOUSE_DOWN,soundonlySync);
	stopper.addEventListener(MouseEvent.MOUSE_DOWN,soundonlySync);
function soundonlySync(event:MouseEvent){
		chnSync.stop();
		chnSync = sndSync.play();
		chnSync.soundTransform=myTransform003; 
		chnSync.addEventListener(Event.SOUND_COMPLETE, loopSoundf);
	}

Open in new window

0
Comment
Question by:ForLoop5
1 Comment
 
LVL 23

Accepted Solution

by:
tailoreddigital earned 500 total points
ID: 39179820
This is kinda a long thread, but very informative.   It goes into detail about multiple audio within Flash and synching it.    At the end of the thread a poster offers a solution using Pixel Bender.

This might point you in the right direction,
http://forums.adobe.com/message/2522272?tstart=0
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now