MP3 code Withdrawn-- code from Arthur Taylor is better#493
MP3 code Withdrawn-- code from Arthur Taylor is better#493jpffitch wants to merge 26 commits intolibsndfile:masterfrom
Conversation
erikd
left a comment
There was a problem hiding this comment.
Seems to have write here, but also need read.
src/mp3.c
Outdated
| #include "common.h" | ||
| #include "mp3.h" | ||
|
|
||
| #if 0 |
There was a problem hiding this comment.
Done; thank you for all your coments.
src/sndfile.c
Outdated
| { SF_ERR_NO_ERROR , "No Error." }, | ||
| { SF_ERR_UNRECOGNISED_FORMAT , "Format not recognised." }, | ||
| { SF_ERR_SYSTEM , "System error." /* Often replaced. */ }, | ||
| { SF_ERR_SYSTEM , "System error." /* Often replaced. */ }, |
src/sndfile.h.in
Outdated
| /* Endian-nes | ||
|
|
||
|
|
||
| options. */ |
There was a problem hiding this comment.
The comment there should be unchanged.
There was a problem hiding this comment.
Sorry; my bad typing and I did not notice. fixed.
src/mp3.c
Outdated
|
|
||
|
|
||
| if (psf->file.mode == SFM_READ) | ||
| return SFE_UNIMPLEMENTED ; |
There was a problem hiding this comment.
Will need to support read before this can be merged.
There was a problem hiding this comment.
Yes; that is my current focus. I still have multiple routes and do not know which way to go. I am still investigating. mpg123 seems heavy and foolswood's attempt seems to have stopped. But I have taken a copy of his code to investigate. minimp3 is wacky, being all one include file. May be the lightest way. There is code in LAME based on mpg123 but the documention/examples I have found look sparse.
| return 1 ; | ||
| } | ||
|
|
||
| /* **** Note that if mode is MONO (3) then left and right channels are averaged and the data is changed. Hence the _M functions **** */ |
There was a problem hiding this comment.
This stereo mix down to mono functionality should probably be dropped.
There was a problem hiding this comment.
So you suggest mono is signalled only by sf.channels? That still leaves the two types of stereo to resolve. I do need to ensure sf.channels is 1 or 2 only.
There was a problem hiding this comment.
So you suggest mono is signalled only by sf.channels?
Yes.
I do need to ensure sf.channels is 1 or 2 only.
A number of formats already require things like that. See sf_format_check in src/sndfile.c.
src/mp3.c
Outdated
|
|
||
| #define CHUNK_SIZE (512) | ||
| #define FRAME_SIZE (1152) | ||
| #define NORMALISE (0.000030517578125) |
There was a problem hiding this comment.
What is that magic number all about?
There was a problem hiding this comment.
1/32K to change short range to [-1, =1]
| #include "lame.h" | ||
| #include "mpg123.h" | ||
| #include <lame/lame.h> | ||
| #include <mpg123.h> |
Think this does it. Not implemented writing by frames but that is really just copying code. Would appreciate any feedback