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

2019-08-16 Thread Mgr. Janusz Chmiel

Lets try to gues how MP3directcut work.
The right is, that I can remove and move block of MP3 files when it is 
loaded. For example, I can copy part of MP3 audio data to clipboard and 
paste it to other part of loaded other MP3 file. And there is no long 
time while working by this way. So MR Pesh must use some very smart 
approach. When I choose save all function, data are stored to other 
file. Other temporary file is being created.

Yes, volume function is being used also if user choose it.
May be, that somebody have invented several complex mathematical 
formulas which can remove data of MP3 files without decompress it.
Sure, some ststrange sound can happen, if user cut some part of active 
sound, but it is also possible when using audio editors which open MP3 
file and decompress it.

I must start from The most simple steps.
How to detect key presses while using Android unit And PPCJVM ANdroid 
JVM target mode. To know, if user have pressed left arrow, right arrow 
on his external bluetooth keyboard.
Next event will be based on GUI element presses detection by using 
onwievclick procedure. So condition blocks will assign two various 
events. From Bluetooth keyboard or other keyboard. The disadvantage of 
my desire is The fact, that I must always unhyde keyboard so other 
commands will detect keyboard presses, so keyboard will interfere with 
app GUI on The screen. But there is no other way.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2019-08-16 Thread José Mejuto

El 15/08/2019 a las 11:04, George Bakhtadze escribió:

mp3 is a loosy audio format. It means that some part of information is 
lost while encoding.
So doing a decoding/encoding cycle just to remove some piece of file is 
a bad idea.
I'd try to find a way to remove piece of audio data without 
decompressing the file similar to lossless operations on JPEG files.


Hello,

As JPEG only have limited operations without decompressing (limited 
rotation and limited cropping), mp3 also have limited operations without 
decompressing, in this case only frame volume change.



--

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2019-08-16 Thread George Bakhtadze
Hello, 14.08.2019, 23:24, "Mgr. Janusz Chmiel" : > 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. mp3 is a loosy audio format. It means that some part of information is lost while encoding.So doing a decoding/encoding cycle just to remove some piece of file is a bad idea.I'd try to find a way to remove piece of audio data without decompressing the file similar to lossless operations on JPEG files. ---Best regards, George
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2019-08-15 Thread José Mejuto

El 14/08/2019 a las 22:23, Mgr. Janusz Chmiel escribió:


I have A very big and non easy dream.
Making similar MP3 editor like MP3 direct cut for Windows is. But sure! 

[...]
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 

[...]
Who of us would have some tip how to find MP3 file format technical 
specifications?


Hello,

There are several documents about the MP3 format, but you only need for 
sure ID3V1, ID3V2 and MP3 frame format. You need ID3V1 and ID3V2 in 
order to skip this information (if you will not use it, as it is 
metadata only) and the MP3 frame format if you want to fast scan MP3 
time duration and scan for stream errors.


https://www.mp3-tech.org/programmer/frame_header.html

All other operations should be done with decompressed audio and in this 
situation nothing is different from MP3, WAV, AAC, OGG, etc.


There are only a few operations that you can apply to a MP3 stream 
without decompressing it, mainly volume change, as you can not, in 
example, remove a block directly from the MP3 stream even if the block 
is an MP3 frame because each frame is dependent of previous frames and 
if you remove one an audible "bleep" can happen (high chance).


So you only need something to decompress MP3 (and maybe other formats).

--

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2019-08-14 Thread Mgr. Janusz Chmiel

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?


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal