Author Topic: Simple Gapless Audio Fix for Flixel  (Read 1582 times)

Kramer

  • Member
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Simple Gapless Audio Fix for Flixel
« on: Sun, Oct 20, 2013 »
I have scoured the web for an embarrassingly long time and found a lot of different answers that didn't work for me or were out of my reach for playing gapless audio files.

See the discussion below for the best answer. I had posted a possible solution but it didn't work as well as I'd hoped so I deleted it.



*On another note, there is a memory leak in FlxSound. See this thread for the fix in case your version doesn't have it.
« Last Edit: Tue, Oct 22, 2013 by Kramer »

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
Re: Simple Gapless Audio Fix for Flixel
« Reply #1 on: Tue, Oct 22, 2013 »
simply use flash cs to embed music

Kramer

  • Member
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: Simple Gapless Audio Fix for Flixel
« Reply #2 on: Tue, Oct 22, 2013 »
Hey paala, I tried that yesterday (with flash cs3) and had issues. I imported the song into the library then added some code to make it loop in the first frame, then exported the swf. Now I cant use that interchangeably with the embed feature in actionscript with flixel. Can you tell me what I missed? I would really appreciate it since I dont think I did this correctly.

Also, when playing that CS3 exported swf just standalone in the browser, I noticed the song playback is as good as the playback you get after processing an mp3 through the mp3loops tool... some songs work great, but the same few songs still have the "pop".

Also, looks like the solution I outlined doesn't work properly for mobile... so its back to the drawing board for me.

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
Re: Simple Gapless Audio Fix for Flixel
« Reply #3 on: Tue, Oct 22, 2013 »
I use this tutorial, nothing else:
http://flashgamedojo.com/wiki/index.php?title=Compressing_Sounds_into_a_SWF
Work on mobile also.

Kramer

  • Member
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: Simple Gapless Audio Fix for Flixel
« Reply #4 on: Tue, Oct 22, 2013 »
Thanks, I will try this out tonight! Looks like I was missing a few details. Do I have to have a Flex project for this to work? Mine's an AS3 mobile project.

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
Re: Simple Gapless Audio Fix for Flixel
« Reply #5 on: Tue, Oct 22, 2013 »
You should use normal as3 project for the flash game , and for the mobile port you should port it fast with adobe air.
If you just began the game you can switch to haxe flixel.
Air  port you must use 2x zoom max resolution 420x240 to have 30 fps in haxeflixel you can use native 800x600 or higher.

Kramer

  • Member
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: Simple Gapless Audio Fix for Flixel
« Reply #6 on: Tue, Oct 22, 2013 »
Got it. My game is a long time in development now, but I am only just now putting effort into the music side of things. So, I guess this method works because it avoids encoding to MP3 altogether... When I tried this yesterday, I was still encoding the wav to mp3 inside the swf and wasn't using embed properly.
« Last Edit: Tue, Oct 22, 2013 by Kramer »

Kramer

  • Member
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: Simple Gapless Audio Fix for Flixel
« Reply #7 on: Tue, Oct 22, 2013 »
Thanks paala, this works flawlessly.