Saturday, December 12, 2009

How to merge/append/join wav segments/files into one?

Appending two or a few Wav files is easy with sound editors such as Audacity, Cool Edit and SoundForge. However, what if you need to join hundreds of files in different directories? Doing this manually is insane...

Recently I needed to do this with a bunch of records in Italian I wanted to put in my mp3-player. I found only a commercial solution, but I decided to code mine.

Todor's WaveAppender 0.01


Platform:Windows.License: Freeware.Warranty: No.

Download:Wave Appender 0.01


Please, post a comment if you find it useful.


Manual 

- Unzip files.
- Open scan.bat and edit the second string to point the path to the base folder with Wav files. E.g.:

scan.exe l:\italian\wave\1\ >list.txt

scan.exe your_full_path_here >list.txt

- Run scan.bat - it generates list.txt.
- Open list.txt and put on top a line pointing to the target directory. The merged files will be created there, e.g.:

l:\wav

l:\italian\wave\0\1b.wav
l:\italian\wave\0\1i.wav
l:\italian\wave\0\2b.wav
l:\italian\wave\0\2i.wav
l:\italian\wave\0\3b.wav
l:\italian\wave\0\3i.wav
l:\italian\wave\0\4b.wav
l:\italian\wave\0\4i.wav
l:\italian\wave\0\5b.wav
l:\italian\wave\0\5i.wav

#
$


- Run append.bat
- Voila! Files from each folder will be merged in 1.wav (first folder in the list), 2.wav, ... N.wav.


Using only appWav.exe

You can edit the list file manually, then you don't need to run the scanner.
The syntax is:

First line - target path
Next - N lists of path to files to be merged in N.wav. A list ends with "#".
The file ends with "$".

Eg.:

l:\wav

l:\italian\wave\0\1b.wav
l:\italian\wave\0\1i.wav
l:\italian\wave\0\2b.wav
l:\italian\wave\0\2i.wav
l:\italian\wave\0\3b.wav
l:\italian\wave\0\3i.wav
l:\italian\wave\0\4b.wav
l:\italian\wave\0\4i.wav
l:\italian\wave\0\5b.wav
l:\italian\wave\0\5i.wav

#
l:\italian\wave\2\1b.wav
l:\italian\wave\2\1i.wav
l:\italian\wave\2\2b.wav
l:\italian\wave\2\2i.wav
l:\italian\wave\2\3b.wav
l:\italian\wave\2\3i.wav
l:\italian\wave\2\4b.wav
l:\italian\wave\2\4i.wav
l:\italian\wave\2\5b.wav
l:\italian\wave\2\5i.wav
l:\italian\wave\2\6b.wav
l:\italian\wave\2\6i.wav
l:\italian\wave\2\7b.wav
l:\italian\wave\2\7i.wav
l:\italian\wave\2\8b.wav
l:\italian\wave\2\8i.wav
l:\italian\wave\2\9b.wav
l:\italian\wave\2\9i.wav
l:\italian\wave\2\10b.wav
l:\italian\wave\2\10i.wav

#
$

Notes:

- Files in each merge group should have the same format, code is pretty simple yet.
- Files in one list can be from different folders.


Thanks

Thanks to Srinivas Varukala (basic code for scanning directories in C#) and Vasian Cepa (Numeric Sorter in C#) for the Scanner part; you can find their code in CodeProject.

Appender code is in C++, written by me.


Keywords: How to merge wav files? How to append wav files. How to join wav files. Merging wav files.

Сборник с разкази и стихове с участието на Тош | A book with Todor's co-autorship



Last month was issued a compilation with prose and poetry, where Todor participates with two short stories.

Wednesday, December 9, 2009

Шофьорът на Москвич 2 - Тодор Арнаудов и Ангел Янев | The Moskvich Driver 2

Филм на Тош




Продължение на "Шофьорът на Москвич", който беше донякъде филмово начало на Twenkid Studio през 2008 г. и беше "ням", не го озвучих. Този път с Ангел, с говор, сочен звук и дори малко музика от мен.

"Шофьорът на Москвич 2" стана най-сетне и дебютът на Ангел. :) Има много хляб в него като комик.

Шофьорът на Москвич





Други ключови думи: москвич, 1500, АЗЛК, комедия, късометражни, филми, 408, 407, копач, джуган, таратайка, соц., комиците

Friday, December 4, 2009

DARPA PAL, CALO, RADAR - Cognitive Assistants that Learn and Organize


Other ambitious AGI projects, and these ones belong to DARPA. Scary!

I have a project for a similar tool that I call "Research Accelerator" or "Cognitive Accelerator", that initially would be an integration of various NLP, Machine Learning and Computer Vision techniques which assist and speed up in searching, reading, information extraction and any cognitive taks. This system also would be capable to work with GUI on its own, controlling the mouse and keyboard to do some job instead of user.

Time is ticking away and I need partners...



PAL - Personalized Assistant that Learns

RADAR - Reflected Agents with Distributed Adaptive Reasoning
CALO - Cognitive Assistant that Learns and Organizes

Monday, November 30, 2009

How to make VirtualDub to append videos encoded at different frame rates?


It's very annoying, isn't it?

In my case, I had 15 fps video, recorded when I had tiny 1GB memory card. Up to now when I found the solution, it was impossible to append them with video shot at 30 fps (All with my sweet Canon Powershot A540, mjpeg 640x480x30fps at about 15 Mbit/s).

VirtualDub of course can convert the framerate to 30 or whatevever. This is the first step:

Video -> Framerate


Also, in order to append to the native AVI, you should use the same compression scheme like in the file you want to append to. In my case - MJPEG.

It's a bit hard to find - MJPEG is in ffdshow section. I suggest you to use high setting to the JPEG like 90 or more to minimize quality losses. (Lossless jpg is best, but different compression.)

Video -> Compression




However, this is still not enough...

When you try to append the resulted 30 fps to a "native" 30 fps produced by the camera, a non-sense error message appears.


It's a rounding error, actually both values are equal to 30.


Solution

Actually, these numbers are values in the AVI headers of the files.
Find the position of these numbers in the files and make them equal.


For Canon A540 and probably the other Powershots it is best to set the values to the "native" values. For other cameras the exact values are probably different.


I located the position there::

0x80: 35 82 00 00

0x84: 40 42 0F 00



You can use a hexeditor, e.g.: XVI32



If you're not a hacker, look on the down-left, this is the position in hexadecimal (80 == 128 in decimal). Put on that places the "magic numbers" (for Canon A540).

And now edit your 15 fps records with the 30 fps ones! :)

PS. Of course it could/should be automated, the easiest way by telling Avery to fix it... ;)


Other keywords: Tricks, Hacks, Solutions, Tricky, Videos running at different framerates, append videos, concatenate videos

Saturday, November 21, 2009

Фантазьори и авантюристи правят великите открития | Dreamers and Аdventurers Make the Great Discoveries (An interview with Todor)


Todor Arnaudov: I'll create a thinking machine that will self-improve.
Dreamers and adventurers make the great discoveries. The sceptics' job is to deny their visions, and eventually not to believe their eyes.

An interview I gave for "Obekti" magazine about Artificial General Intelligence and the research I do in this direction.


I may publish the interview in English after enough time passes after the publishing.






Четете в брой 5, ноември/декември на списание "Обекти"!


Keywords: Artificial General Intelligence, Cognitive Computing, Thinking Machines, Seed Intelligence, Bottom-top approach, Self-improving AGI, AI, Artificial intelligence, Researchers in AG, Todor Arnaudov, Изкуствен интелект, универсален изкуствен интелект, мислещи машини, изкуствен разум

Sunday, November 15, 2009

Solid Optimizer Project (SolidOpt)

Това е проект на колеги от ФМИ на ПУ, Александър Пенев и Васил Василев и както те се изразяват представлява инструментариум за автоматизирано оптимизиране на софтуерни приложения. Тази седмица двамата имаха интересна презентация във ФМИ.

Накратко, системата цели да оптимизира код написан за момента .NET (евентуално на друг език с виртуална машина), като се опитва да го декомпилира в известна степен и след това да го опрости. Например - замяна на променливи с константи, съкращаване на дълги функции, за да могат да се вкарат като "inline" и мн. др.

Проектът звучи много обещаващо, а Сашо и Васил са пълни с идеи. Търсят се и други ентусиасти, които да се включат в разработката.

Sunday, November 1, 2009

Operant conditioning, Reward pathway, Reinforcement learning - Beginners directions to Artificial General Intelligence, Part 2

На български - втора част от Въведението в Силния ИИ/Универсалния ИИ.

Условни рефлекси, Оперантно кондициониране, обучение с подкрепление, допамин, пристрастяващо поведение и др. - Насоки за начинаещи в Универсалния изкуствен интелект. Психология, адаптивни системи, философия, икономика. Очаквайте скоро.
...

Part I - References to important researchers in Artificial General Intelligence

Part 2 - Classical conditioning, Operant conditioning, Reward pathway, Reinforcement learning

Introduction

In this article I'll emphasize several important concepts in Psychology, Human and animal behaviour, Adaptive systems and Learning. It has also something to do with Utilitarism in philosophy and economy.

1. Conditioning and Operant conditioning


Conditioning is related to the experiment of I. Pavlov with his famous dog's conditional reflex. Operant conditioning, formulated by Skinner in his Behaviorism goes much further with the inclusion of predictive conditioning that I would say, implies will and goal-driven behaviour. Rats or pigeons learn to press a lever, when they notice that after this action they receive a reward - food or even direct electric stimulation of a pleasure center in the brain.
Reinforcement - in operant conditioning, reinforcement occurs when an event following a response causes an increase in the probability of that response occurring in the future.
(Wikipedia)
I.e. when the rat gets food after pressing the lever, it's more likely to press it again. If it presses it many times, expecting food, but not receiving any, this behaviour is going to be inhibited and forgotten. The rat would adapt. First, it adapts to the case that pressing the lever is getting him reward, then it readapts that this behaviour is not rewarding anymore, and it's better to seek or focus on another one.

2. Reward pathway

Reward pathway is a mechanism in the brain, linked with learning, repetitive and goal-driven behaviours. It has something to do with dopamine neurotransmitter.

Addictive, repetitive and goal-driven behaviours are often related to affection of this mechanism, either by taking drugs or generating dopamine and other "natural drugs" by the brain, when you put yourself in particular behavioural patterns.

3. Love and post-traumatic disorders in terms of conditioning

For example, love is an addiction to an operant conditioned stimulus, that lover finds a source of very big rewards: sex, care, emotional support, fun, responsiveness to any of his needs etc.

Strongly conditioned stimulus are not only wanted, but expected to happen - being reinfoced many times, and giving very big rewards. This is the reason of the tragedy when the other lover lets you down or brakes up suddenly - she is causing a shocking and undesirable change in the expected rewarding pattern.

Post-traumatic stress disorders are also related to conditioning. When somebody suffers a painful experience, especially in young age, the brain may slip into wrong directions of making connections (conditioning) between many stimulus and the bad feelings of the traumatic situation. Every time when the sufferer is in a situation with even tiny similarities, the brain may start making wrong predictions, expecting undesirable outcomes like in the traumatic situation; all these resulting in fear, pain and a behaviour of avoiding such conditions.

4. High Level

At high level these concepts are related to the intelligent systems' principle of predicting future stimuli through extrapolation/projection/simulation of the past stimuli (experiences).

Intelligence is also a mechanism that aims at maximizing the probabilities of desirable/wanted stimuli and minimizing the probabilities of unwanted ones. Concepts of will and goal-driven behaviour take part at this point.

5. Self-control and long term goals vs short term ones

It worths thinking of these concepts also when considering your own behaviour and changing it. For example when thinking of longer term goals, instead of shorter term ones. The shorter term goals may give you immediate rewarding response, thus throwing you to local maximum" of pleasure and preventing you to find a higher local maximum or even the "global maximum". The global maximum could be reached after passing through some "minimums" - unrewarding activities in short term - which a shorter term reward strategy may not accept.


...To be continued...


Sunday, October 25, 2009

Сватбата - втори трейлър на комедията





Очаквайте скоро целия филм!

Синопсис: Млад репортер отива да заснеме репортаж от масовата сватба на Сектата на ФМИ. Всичко се преобръща, когато разбира, че присъствайки, той също трябва да бъде оженен. Няма измъкване и не се знае за коя точно ще го оженят. Историята обаче не свършва дотук...

В ролите: Тодор Арнаудов, Костадинка Делева, Никола Вълчанов, Иванка Николова и др.
Сценарист, режисьор, оператор, монтаж, звук, музика - Тодор Арнаудов.

Twenkid Studio:

http://twenkid.com
http://twenkid.blogspot.com


Първи трейлър



Wednesday, October 21, 2009

Beginners guide to Artificial General Intelligence (AGI, Strong AI, Universal AI) | Силен изкуствен интелект, универсален изкуствен интелект

I'll just direct you to the people, the rest is reading, reflection and speculating.

Jeff Hawkins - his book "On intelligence" is a must, check out Numenta and what Hierarchical Temporal Memory is.

Ben Goertzel - and his company "Novamente".

Boris Kazachenko


Jurgen Schmidhuber

Marcus Hutter

Hugo de Garis

Singularity Institute

...

Todor Arnaudov - his theory of Mind and Universe. Works from early 2000-s (yet in Bulgarian only) which are going to be continued.

Ако знаете български, може да разгледате и моите спекулации, моята Теория на разума и Вселената. Тя включва и много философия, метафизика за Вселената и разума и връзката между тях. Има нужда да я опиша в по-стройна форма и не е напълно формална, в нея по свой път, както след години открих, съм преоктривал понятия като алгоритмична теория на информацията, структури подобни на това което се смята за работата на кората на мозъка (неокортексен стълб) , цифрова физика/философия и мн. други ключови неща.

Алгоритмичната теория на информацията/алгоритмична вероятност е свързана с разсъжденията в теорията, че в една "Вселена сметач", нещо е по-сложно и по-малко вероятно от друго, по-трудно да съществува, ако за създаването му е необхододима по-сложна (тук не го бях дефинирал добре формално) програма на "машинния език" на който работи Вселената, където се създава това"нещо".

Ако физичните закони са "езикът на частиците", то от тази гледна точка създаването на човешките артефакти е много по-сложно за Вселената ("Вселенският сметач"), отколкото създаването на човека, защото вторите са невъзможни преди да съществуват "програми" (майка, оплодена яйцеклетка, в която има ДНК), които могат да построят от атоми тялото на потенциалния развит разум.

Предстои да работя по теорията и да напиша нови по-стройни и разширени версии.

Засега е тук- http://eim.hit.bg/razum

Monday, October 19, 2009

Първият ми сценарий за образователно предаване по телевизията | My first educational TV show broadcasted on a National TV!


It was about 35 minutes long, called "The Megapixels" - about photography, cameras and digital photography. It was broadcasted on BNT, 17:00 on 14.10.2009.
The breakthrough was done!

...

На 14/10 по БНТ беше излъчено предаване по мой сценарий. Брой на "В час ли си" за фотография, "Мегапикселите". Някои дребни детайли са били отрязани, като динамичния обхват, но като цяло мисля че се е получило много изчерпателно и интересно предаване, не само за техническата, но и за художествената страна. Фотографите добре са обяснили какво е най-важно в снимката.

И за първи път няколко мои снимки бяха показани в национален ефир. :P

Предаването го има тук:

"В час ли си", епизод за фотография,"Мегапикселите". Сценарий - Тодор Арнаудов.


...

Работя и по "Сватбата"... Вече започва да се вижда края на много от монтажа и почти всички снимки, но има и много озвучаване...

Тодор Арнаудов в кадър от "Сватбата"
Todor Arnaudov in "The Wedding"


Трейлър на "Сватбата"