Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "KOL";
Текущий архив: 2005.10.23;
Скачать: [xml.tar.bz2];

Вниз

KOL MP3 SetPosition and Lenght bug...   Найти похожие ветки 

 
Sormy   (2005-02-19 12:21) [0]

TMPEGPlayer
Как избежать некорректных значений Lenght (меняется во время проигрывания)
Как реализовать SetPosition? (доcтупна только GetPosition)


 
thaddy   (2005-02-19 14:15) [1]

:-) You have to read and decode the raw buffer and skip the number of samples. This is the only way to set the position with MP3 files, since they contain only raw compressed data per frame and not exact decoded data per frame. There's also the matter of CBR or VBR, so you have to decode it first.
There will be a new demo out soon that does this. The way the current demo calculates the position is only valid when you do not pause. This has to do with the internal buffers, that may still contain audio data when paused. Note also that the UI is a quick demo, not mend to be used seriously. The codec IS seriously and seriously good too (Way better than Microsoft's f.e.)
Thaddy (author kol version, maintainer VCL version)


 
thaddy   (2005-02-19 14:16) [2]

:-) You have to read and decode the raw buffer and skip the number of samples. This is the only way to set the position with MP3 files, since they contain only raw compressed data per frame and not exact decoded data per frame. There's also the matter of CBR or VBR, so you have to decode it first.
There will be a new demo out soon that does this. The way the current demo calculates the position is only valid when you do not pause. This has to do with the internal buffers, that may still contain audio data when paused. Note also that the UI is a quick demo, not mend to be used seriously. The codec IS seriously and seriously good too (Way better than Microsoft's f.e.)
Thaddy (author kol version, maintainer VCL version)


 
Sormy   (2005-02-19 17:17) [3]

Thaddy, thanks for your work!

While mp3 is playing the Lenght isn"t constant! But it sometimes has RIGHT value!

Standart TMediaPlayer also lies about mp3"s lenght.
But it can Set Position and can open mp3"s 50/50% (sometimes error ocured)...


 
thaddy   (2005-02-19 18:51) [4]

That has to do with VBR, I only use CBR for timing in my example.
If the mp3 is VBR encoded, position will fail. The Tmediaplayer uses the installed ACM codecs and *also* decompresses first to set the position. The reason TMediaplayer fails, is because of the bad quality of the microsoft mp3 driver (not only soundwise). It also can"t handle vbr properly and can not use mp3"s with bad headers.
One of the reasons my example uses so few resources (comparatively) is that it tries to avoid decompression. Also Tmediaplayer MP3 uses at least 6 times, more like 10 times as much memory!
The problem with VBR frames is that you never know the length of the decompressed audio beforehand, so you have to guess or introduce a delay to decompress everyting first and then do the timing calculations. Also: sometimes there simply is not enough information written in the MP3 to do the timing properly.


 
thaddy   (2005-02-19 18:59) [5]

Also: check the code for 128 bps, maybe you have the version that uses hardcoded 128bps which was a bug. If timing is important I will try to build it in, but that defeats the meaning of the code:just play mp3"s nothing more, nothing les, nothing fancy.
Note that the code is already very complex and it would be even more so if there were two decompression streams and an extra thread in the code at the same time (necessary for searching backwards in the frames). I"d rather keep it as it is and just fix the -small- bugs in the core that are still left. :-)


 
SPeller ©   (2005-02-20 09:34) [6]

The VCL original is buggy, and not support VBR. It is better to use an C++ dll, such as LAME.


 
Motherhacker   (2005-02-20 13:42) [7]

2 SPeller
You english is LAME! :)


 
Motherhacker   (2005-02-20 13:43) [8]

OOps! I meant "your"!


 
SPeller ©   (2005-02-20 15:48) [9]

Motherhacker   (20.02.05 13:42) [7]
You english is LAME!

I know :)


 
thaddy   (2005-02-20 16:02) [10]

My current VCL and KOL versions support VBR


 
Sormy   (2005-02-21 17:08) [11]

2 SPeller:
Но мне необходимо проигрывать МП3, получать нормально длину, позицию и эту позицию устанавливать.
Можно ли как-нибудь плагины от ВинАМПа приспособить под это дело?


 
thaddy   (2005-02-21 17:17) [12]

DecompressedBuffer div (SamplesPerSec * 4) = TimePerBuffer


 
SPeller ©   (2005-02-21 19:07) [13]

Sormy   (21.02.05 17:08) [11]
Можно. Или на сайте винампа помотри старый SDK к плагинам, или на сайте Кладова демку, которая работает этими плагинами.

thaddy   (20.02.05 16:02) [10]
My current VCL and KOL versions support VBR

Это хорошо. Как понадобится - испробую.


 
Sormy   (2005-02-21 22:34) [14]

2 Speller:
Клево! Совсем забыл, что на сайте Кладова уже есть модули работы с винамповскими плагинами. Судя по исходникам - там есть все, что нужно...
Вроде бы и SetPosition реализован...
Конечно, винамповские плагины весьма не малы в размере, но пока что это единственная альтернатива... :-)

2 Thaddy:
Thanks! But where I can download new sources of TMPEGPlayer? I didn"t find they on your homepage (there are only Pico Player exist)...


 
thaddy   (2005-02-21 23:08) [15]

Source as indicated:on request. Mail me. I have to check them out and prepare them as release, see.


 
SPeller ©   (2005-02-22 04:41) [16]

Sormy   (21.02.05 22:34) [14]
винамповские плагины весьма не малы в размере

Ты шутишь? mp3 плагин весит всего 140 КБ.


 
Sormy   (2005-02-22 21:47) [17]

2 Thaddy:
 mmm... Then... please... on mail e-mail: sormy@mail.ru :-)

2 SPeller:
У меня от ВинАМПа 5 аж 500кб in_mp3.dll занимает :-)
В 2.ХХ меньше по ходу дела :-)


 
SPeller ©   (2005-02-23 09:43) [18]

Sormy   (22.02.05 21:47) [17]
В 2.ХХ меньше по ходу дела :-)

Угу, я привел размер от 1.91.



Страницы: 1 вся ветка

Форум: "KOL";
Текущий архив: 2005.10.23;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.48 MB
Время: 0.062 c
4-1124447846
BFG9k
2005-08-19 14:37
2005.10.23
Некорректное поведение RasGetEntryDialParams


2-1127455271
Гость22
2005-09-23 10:01
2005.10.23
Как узнать, что запущено сторонее приложение?


14-1127992402
alk20
2005-09-29 15:13
2005.10.23
Помогите программа не работает так как надо из под win 98


14-1128496222
vidiv
2005-10-05 11:10
2005.10.23
Новый админ на сайте


3-1125980122
novikova
2005-09-06 08:15
2005.10.23
Не редактируется поле с LOOKUP





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский