[fpc-pascal] where to find materials about MP3 file format

Mgr. Janusz Chmiel janusz.chmiel at volny.cz
Wed Aug 14 22:23:47 CEST 2019


I have A very big and non easy dream.
Making similar MP3 editor like MP3 direct cut for Windows is. But sure! 
I would like to develop it for Android. And I want to support keyboard 
letter commands such as inside MP3 directcut for Windows. Sure. I Am not 
so expert like MR Martin Pesh is. So I must go much more easier way. I 
want to only develop engine, which will play, stop, will support left 
and right arrow key as A key for making forward and backward. And 
especially, and this is The most important, I want to support Block 
operations to assign beginning of block and its end. And mainly, I want 
to use remove block command, which will hae immediate effect. So MP3 
engine will skip previously non removed data. What do I need?
Some technical manual about MP3 format. Sure. Even Android media player 
will allow Me to play, forward, backward, playand stop. But I must have 
deep knowledge about MP3 file format structure. So I will be able to 
remove block. MP3directcut do not remove data directly from existing MP3 
file or from temporary copy of this file. It making software magic so 
software counter, which control The playback simply do not know about 
previously assigned MP3 part for removal.
Removed data are physically stored after user use corresponding save 
function from menu. Before this, user can remove as much part as he or 
she wants. To prevent Android crash, I will avoid to use clipboard 
operations. Android is not Windows and too big data chunks may be cause 
some memory allocation issues.
Who of us would have some tip how to find MP3 file format technical 
specifications?
Pascal support binary file operations. So real data manipulations will 
begin after user press function save changes. Sure. As MP3 directcut, I 
will have to use The same approach. I must create copy of original file 
after user press save and after this copy will be created, I must 
manipulate with data. I think, that I will have to use array which will 
contain beginning and end of MP3 data for removal. It will not be easy work.
But as I have written previously. I do not have ambitions to create real 
clone of MP3 direct cut for Android with all of its functions.
I want only play, stop, forward, backward while play. MP3 directcut uses 
frames approach. So I will have to include slider which will allow users 
to specify number of MP3 frames while backward and forwarding.
Existing MP3 editors for Android on Google Play are not comfortable for 
Me. It do not support keyboard shortcut and it is not possible to remove 
many parts of MP3 files. Only one selection inside one file.
I hope, that PPCJVM compiler contain enoug of internal command to create 
this tool.
Sure. I will use Android Media Player APIS, thanks to creator of 
Pandroid, I have functioning example how to call it even without crashes 
and memory allocation leaks. The most difficult part will be to 
correctly reproduce original MP3 file when saving data without removed 
MP3 blocks.
Sure. Application must be usable also for sighted users so I will not 
only use keyboard show method without GUI. App will contain The series 
of Buttons. By The way. Do you know, that Pandroid bundle contain 
special unit, which will allow you to combine buttons with A nice .png 
pictures? And GUI look very nicely. You will be able to scroll among 
many many buttons without crashes. And you will not had to use object 
position values.
But how to achieve The complex algorithm for recreating MP3 file. It 
will not be easy walk across The park. I will also have to use effective 
approach to prevent memory allocation problems. I hve analysed Github 
but there was no useful source codes. May be, that somebody of us would 
give Me some tips and tricks.
I do not want to use Basic, since interpreter machine contain many many 
lines of Java source code. And I Am convinced, that when I compile app 
directly to .dex format by using PPCJVM Android JVM target, resulting 
code would interpret faster than one Millisecond for one command. But I 
do not know, how to measure so complex thinks. It would be interesting, 
if somebody, who have created PPCJVM would try to make some scientific 
measurement on some device. Or do you think, that it will be even much 
more slower than One Millisecond per one Pascal command?



More information about the fpc-pascal mailing list