| View previous topic :: View next topic |
| Author |
Message |
daaa57150
Joined: 17 Nov 2006 Posts: 28
|
Posted: Tue May 27, 2008 7:38 pm Post subject: Sound: perfect loop |
|
|
Hi,
I have a really hard time figuring out how to make a sound loop perfectly. I tried OSLib's inbuilt functions with BGM (oslib special sound format) and MP3, and I can always hear the gap between 2 loops. I searched other ways to play my MP3 in a loop and got a bit lost... I *think* all MP3 players do it the same way: they fill a buffer of a predefined size with decoded frames and when at the end of the file, fill the rest of the buffer with 0's, thus the non perfect looping I get.
Does something exist that would play my sound in a perfect loop? I need something with the source available or appropriate hooks because I want to synchronize other objects with the sound, and of course I want it to be compatible with all PSP FW versions.
As I'm pretty sure nothing like that is available, can someone teach me / help me with writing such a thing, as I'm very uncomfortable with so low-level & C (not ++) code.
If you want to test, here is the MP3 I use: http://www.newgrounds.com/audio/listen/59771
It loops perfectly in Itunes & winamp (but not in this flash app).
Thanks. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed May 28, 2008 2:52 am Post subject: |
|
|
MP3 is NOT gapless. LAME encoded MP3s include metadata in the MP3's tags which indicate the exact length of the song. Only players that support reading this metadata will stop playback at the exact moment, while others will play till the padding is over.
Use AT3 files for gapless. |
|
| Back to top |
|
 |
daaa57150
Joined: 17 Nov 2006 Posts: 28
|
Posted: Wed May 28, 2008 4:34 pm Post subject: |
|
|
| Ok thanks, I'll see if I can make an AT3 file loop correctly. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Wed May 28, 2008 7:15 pm Post subject: |
|
|
| Quote: | | MP3 is NOT gapless |
WHAT??? What are you guys speaking about?? Every compression technique under the sun does divide data into chuncks; it's up to the decoder to present data continuously. If i correctly understand the original question, the clue is on buffering techniques: i pointed out the lack of proper buffer handling in pspsdk sound library time ago. However, double and triple buffering are not necessarly related to PSP: i bet you'll have better luck finding out how to implement such techniques in a general purpose programming site. |
|
| Back to top |
|
 |
daaa57150
Joined: 17 Nov 2006 Posts: 28
|
Posted: Wed May 28, 2008 7:46 pm Post subject: |
|
|
So it really is a buffer problem..
If I manage to write an mp3player with proper buffer handling, (ie: when at the end of the MP3 file, continue with the start of the file), it will be fine then?
If so, I was right and I need some help! |
|
| Back to top |
|
 |
daaa57150
Joined: 17 Nov 2006 Posts: 28
|
Posted: Fri May 30, 2008 7:41 pm Post subject: |
|
|
sorry to bother again, but could someone share a recent compiled lib mad (.a and .h)? I still have no connection at home and can't access any svn from my work.
I can give you my mail by PM.
Thanks. |
|
| Back to top |
|
 |
|