forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Solved] MP3 issues - unusual header

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
foebea



Joined: 23 Mar 2007
Posts: 9

PostPosted: Sun Sep 16, 2007 5:23 am    Post subject: [Solved] MP3 issues - unusual header Reply with quote

Heyyas all, I am working to support 22khz mp3 for my application. I have tried tearing apart the code of others to find out how to properly decode audio. The code by Cooleyes just recently is a huge help with this, but still my problem remains.

The audio file in question is a short (few seconds) which on every homebrew mp3 player has distortion and clicks, followed by a staticy rendition of the vocal at double speed.

When I play the same file with the sonys builtin music player it plays normally, with full audio, no distortion, no problems.

I don't suppose there is a way to call the builtin player to play audio files, yet no matter how i fiddle with source which claims to support 22khz, i cant rid the distortion.

It is not a viable solution to just reencode the audio to 44khz, as they are supplied by the user at runtime, and there are many thousands of them for each user.

I have been struggling with this since March :D
Any assistance would be appreciated and fully credited.

here is a sample mp3 which plays fine in sonys psp music player, but is messed up everywhere else: http://www.poorlywritten.com/piki/images/6/6e/Test.rar


Last edited by foebea on Sun Sep 16, 2007 2:29 pm; edited 2 times in total
Back to top
View user's profile Send private message
crazyc



Joined: 17 Jun 2005
Posts: 410

PostPosted: Sun Sep 16, 2007 6:12 am    Post subject: Re: MP3 issues - quagmire? Reply with quote

That file has a unusual 324 byte header which confuses libmad. If I chop off the header, it plays fine.
Back to top
View user's profile Send private message
foebea



Joined: 23 Mar 2007
Posts: 9

PostPosted: Sun Sep 16, 2007 6:31 am    Post subject: Reply with quote

That would certainly explain it. if it starts trying to decode nonstandard data it messes up the data sync for the rest of the file.

Exactly how would I go about skipping over that header?
If you solve this for me I will be forever in your debt (or at least until friday, if you can accept paypal)
Back to top
View user's profile Send private message
crazyc



Joined: 17 Jun 2005
Posts: 410

PostPosted: Sun Sep 16, 2007 8:06 am    Post subject: Reply with quote

foebea wrote:
That would certainly explain it. if it starts trying to decode nonstandard data it messes up the data sync for the rest of the file.

Exactly how would I go about skipping over that header?
If you solve this for me I will be forever in your debt (or at least until friday, if you can accept paypal)
If you build libmad with OPT_STRICT defined, the file plays correctly with the header.
Back to top
View user's profile Send private message
foebea



Joined: 23 Mar 2007
Posts: 9

PostPosted: Sun Sep 16, 2007 9:07 am    Post subject: Reply with quote

I have found this functionality for OPT_STRICT in the layer12.c and layer3.c in the src directory, but I have not found in any of the files from svn where I would actually define anything. My best guess is that this would be done with configure, but ps2dev svn does not include a configure.sh or autogen.sh or anything like that.

Do I just need to add #define OPT_STRICT to one of the files?
I have been checking for instances in the source and includes that look like they would accept something like this, and have googled for similar scenarios. nothing is popping out.

Sorry for all the questions.
Back to top
View user's profile Send private message
crazyc



Joined: 17 Jun 2005
Posts: 410

PostPosted: Sun Sep 16, 2007 9:28 am    Post subject: Reply with quote

Quote:
Do I just need to add #define OPT_STRICT to one of the files?
Yes, config.h is probably the most appropriate place.
Back to top
View user's profile Send private message
foebea



Joined: 23 Mar 2007
Posts: 9

PostPosted: Sun Sep 16, 2007 9:52 am    Post subject: Reply with quote

ah.... I feel blind. I even looked at that file.
it should have all come clear when I saw:
#define OPT_SPEED

Thanks so much for your help. I will try that out as soon as I get back to my computer.
Back to top
View user's profile Send private message
foebea



Joined: 23 Mar 2007
Posts: 9

PostPosted: Sun Sep 16, 2007 2:33 pm    Post subject: Reply with quote

This has absotively solved my issue. I thank you. My users thank you. This means they can stop manually converting mp3s to 44khz and really start to use the program. I will pay a bounty for this one, if you want it. I had thought the audio issue was completely due to bad memory management on my side until recently, and I had almost gotten to the point at attempting a full rewrite in a different language. I can be reached at gmail if you would prefer not discuss reward here. Thanks again!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group