Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: New EncSpot like app (Read 54922 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

New EncSpot like app

Reply #125
Long live OOP then 

It's ok to use classes it is just a matter of taste after a certain level. After all Delphi is classes and Delphi is fast.

240 ms for a 14 mb file is not bad for single file processing but it is a bit too much for 100's of files, did you try the standard blockread command to compare speed?
Dimitris

New EncSpot like app

Reply #126
It took 240 ms to analyze the file prebuffered in a TMemoryStream object, not to analye AND prebuffer the file, therefore it can't be compared to Blockread access. If is a too bad value (i think it's not too bad).

TBitwiseStream reader actually does read a byte and form the requested value bit by bit until all 8 bits of the byte are read (buffer-byte is empty). In that case it does read the next byte and continue decoding.

There are three possibilities:

1. TMPEGAudio buffers parts of the file to TMemoryStream and then passes it to TMPEGAudioFrame
2. The improved ATL comes with a TBufferedFileStream component (which I could implement)
3. A custom buffered file stream component can be used in the main program

Here some other results with the TMemoryStream-prebuffered 14 MB file:

1. Decoding frame headers took >15 ms
2. Decoding frame headers and decoding side information with non-fuctional, blanked out GetBits method (TBitwiseStreamReader) took >108 ms
3. Improved code a little bit (reduced amount of object creation and destruction) and now frame header and side info scanning takes >156 ms
4. Took the improved code and blanked out GetBits again >15 ms
5. Changed the TBitwiseStreamReader.GetBits method NOT to check if stream position was changed. Now the caller MUST reconnect with the ConnectTo method to reset the buffer. Now it takes >108 ms, fully functional as before.

I think 108 ms should be acceptable at all for a 14 MB MP3 file (23534 frames). But remember that runtime will be much higher if the new GuessEncoder method will be used. Just storing all frames in a TObjectList (like TMPEGAudio will do) will produce results like 219 ms. And with statistics gathering, which is needed for a good guess, it will take even more.

EDIT: Next thing to do is a Synchronize method in TMPEGAudioFrame which returns either a negative value (which means that no frame was found in stream) or a positive value which shows the distance between the position where it started to search and the position where it did find a frame.

New EncSpot like app

Reply #127
Changed on 23th June 2004:

Resynchronization was quite easy to do as I already had two overloaded methods called ReadFromStream which return TRUE if a valid frame (valid header) was found at the actual or passed stream position.

So I added a third one and here's the code:
Code: [Select]
function TMPEGAudioFrame.ReadFromStream(Stream: TStream; Offset,
 SyncDistance, SubsequentFrames: Integer): Boolean;
var Frames: Integer;
   Distance: Integer;
   FramesSize: Integer;
begin
 Distance := 0;
 Frames := 0;
 while (Frames < SubsequentFrames) and (Distance < SyncDistance) do begin
   Frames := 0;
   FramesSize := 0;
   while (ReadFromStream(Stream, Offset+Distance+FramesSize)) and (Frames < SubsequentFrames) do begin
     inc(Frames);
     inc(FramesSize,Header.FrameSize);
   end;
   if (Frames = SubsequentFrames)
   then ReadFromStream(Stream, Offset+Distance)
   else inc(Distance);
 end;
end;


As you can see you can set the maximum resync distance in the SyncDistance parameter and the number of subsequent valid frames to check in the SubsequentFrames parameter. Old TMPEGaudio tries to read two subsequent valid frames, I suggest searching for three frames and will do so in the new TMPEGAudio component.

New EncSpot like app

Reply #128
IMHO you must start a new thread in the forum so we can follow and comment easier.
Dimitris

New EncSpot like app

Reply #129
Hi!

Is there something new to try out? And where can I get the old version? The download links in this thread seem to be dead.

[edit] ok, found the other thread and links
http://burrrn.net/mrq/

New EncSpot like app

Reply #130
Hello Gambit,

I think Mr. QuestionMan is a really cool und useful tool.

I have a suggestion.
What about adding a option to use auCDtect for scanning the origin of wave files?

http://www.hydrogenaudio.org/forums/index....topic=22815&hl=

I think this option could be very useful because auCDtect is only a CLI-programm right now.

What do you think about the idea?

Adding a useful "SchnickSchnack" option 

New EncSpot like app

Reply #131
can anyone re-post ver. 0.3 final? the link on his page doesn't seem to work.
thanks.


New EncSpot like app

Reply #133
Any news on MrQuestionMan, Gambit?

- Lyx
I am arrogant and I can afford it because I deliver.


 

New EncSpot like app

Reply #135
Quote
There is a beta available with TTA support, fixed WavPack support and some other small changes/fixes.
http://burrrn.net/mrq/Files/MrQuestionMan06beta.zip

I'd like to finish Unicode support for the 0.6 version, but Delphi isn't exactly Unicode friendly, so let's see...
[a href="index.php?act=findpost&pid=234605"][{POST_SNAPBACK}][/a]


Hi Gambit,

Really thanks a lot for coding Mr.Question Man (I think it's a good name, friendly!)

Especially like the "Shame on you for having WMA files". Ha ha ... I don't like WMA but downloaded from online radio and don't want to transcode :-)

Ver 0.5:
I've tried Japanese and Chinese, both seems working on filename but not for folder, should be part of the Windows' and part of Delphi's problem.

Ver 0.6beta:
Double byte (Unicode?) not working on filename now, waiting for your good news.

Thanks again Gambit!
Hong Kong - International Joke Center (after 1997-06-30)