Solved

gapless sync and playback  audio as3

Posted on 2013-05-19
1
345 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

763 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

16 Experts available now in Live!

Get 1:1 Help Now