| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Jul 2005
Posts: 40
|
I am trying to have an mp3 sound play in the background as a seamless loop. I am using the Sound and SoundChannel class and I can play the sound fine. The problem I have is that when the sound loops there is a small gap between the end of the loop and the start at the beginning. I did a search I didn't find any obvious solution. Is there something I'm missing here, this seems like a very basic feature.
From what I understand this issue has to do with the encoding of the mp3 file. So what do I need to do in order to export an mp3 file without the silent gap? Is there any workaround in flash to get around with without editing the audio files? What about support for other audio formats aside from mp3? Any help will be greatly appreciated. |
|
|
|
|
|
#2 |
|
Banned by AS.org Staff
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,075
|
The problem was the same with AS2.0... Don't see why it'd be different for AS3.0...
Looping soundObjects have never looped as seamlessly as simple timeline looping sounds. On some of them (again on AS2.0), playing with the second offset parameter would help to shorthen the gap, but it wasn't very steady... |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jul 2005
Posts: 40
|
What has changed is that you were able to use wav sounds for music previously, and it appears AS3.0 only supports mp3 audio. I was hoping there was something new to AS3.0 that would help with looping sounds, but I guess not. So is the only way to use the timeline for placing sounds? There must be some workaround with code.
Last edited by cybereality; 02-03-2008 at 11:10 PM.. |
|
|
|
|
|
#4 |
|
Site Contributor
|
MP3 files are the only kind that can be loaded from an external file. You can still import WAV files to the library, give them a class name, and play them with Actionscript (without placing them on the timeline).
__________________
My new website: theflashconnection.com |
|
|
|
|
|
#5 | |
|
Registered User
Join Date: Jul 2005
Posts: 40
|
Quote:
Heres the code if anyone is interested: Code:
var soundLoop:Sound = new LoopingSound(); soundLoop.play(0, 99); |
|
|
|
|
|
|
#6 |
|
Site Contributor
|
Exactly!
By the way.... If your sound file does have a gap of silence (one that isn't flash's fault), you can edit it out with Audacity. This free program came on a disk with a USB turntable I got, but you can also get it as a free download from: http://audacity.sourceforge.net/. Consult the help files to learn how to export MP3, as it involves downloading a dll file, which isn't a big deal either. After playing with the program and the turntable for awhile, and recording a few vinyl albums, I realized that you can also use the program to easily load and edit any MP3 files, and other sound file types, too, including WAV. Find and highlight the gap of silence, and press the delete key. Easy! Then, save (export as MP3) the file under a different name to preserve the original.
__________________
My new website: theflashconnection.com |
|
|
|
|
|
#7 |
|
Registered User
Join Date: Jul 2005
Posts: 40
|
|
|
|
|
|
|
#8 |
|
Registered User
Join Date: Jul 2005
Posts: 40
|
It turns out that the audio file did need editing with audacity, although the mp3 streaming was making the problem worse.
Last edited by cybereality; 02-25-2008 at 07:45 AM.. |
|
|
|
|
|
#9 |
|
Registered User
Join Date: Sep 2008
Posts: 4
|
u can use the below for endless looping-
soundLoop.play(0, int.MAX_VALUE); |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Kenny Bellew Sound Object Tutorial Updated | Kennyb | ActionScript 2.0 | 23 | 05-09-2007 09:38 PM |
| Sound Looping Malfunction | smalls312 | ActionScript 2.0 | 2 | 03-01-2006 12:02 AM |
| looping sound and silent space question? | ladyofbenjamin | ActionScript 2.0 | 3 | 04-24-2005 08:26 PM |
| Sound looping and soundoncomplete time lag | jingomelingo | ActionScript 2.0 | 0 | 04-01-2005 09:33 AM |
| Stopping movie but keeping sound looping | phil_roy | ActionScript 1.0 (and below) | 2 | 02-02-2002 10:57 PM |