Posts Tagged ‘motherland’

Linux record audio from console / terminal with rec, arecord and ffmpeg

Monday, January 14th, 2013

 

Recording sound input from microphone linux penguin holding microphone

Recording from microphone input on Linux is possible, through multiple programs.

1. Recording microphone input using SoX's rec

 The classical old-school way is through a little proggie called sox. Back in the day I remember we recorded with sox with a friend from the school years necroleak – mirror of his website is on kenamick.pc-freak.net, trying to make save vox for one of his Tracked Songs. The experiments was not very succesful as both the PC microphone was low quality one, as well as the the state of recording microphone sound streams on Linux was terrible, but at least I learned about sox.

sox is not so popular and mainstream as it used to be back in the day but for anyone willing to investigate into the roots of GNU / Linux sound capturing make sure you have installed sox, alsa-utils and lame package. The package is available across virtually all main stream Linux distributions, depending on the distro to INSTALL sox do:

 

apt-get install --yes sox alsa-utils lame 
....

 (On Debian, Ubuntu, Arch, Xubuntu … )

yum -y install sox  alsa-utils lame
....

 (on Fedora, CentOS, RHEL …)

 slapt-get install sox ; swaret install sox alsa-utils lame
.....

(on Slackware and derivatives)

Before continuing it is a good idea to check, the microphone is not muted in alsamixer, amixer or aumix

The SoX package provides 4 binaries;

dpkg -L sox|grep -i /usr/bin/
/usr/bin/sox
/usr/bin/rec
/usr/bin/play
/usr/bin/soxi

sox -is tool to apply effects to recorded sound streams

rec – is historically among the first sound recorder tool to make records from microphone (even form the days of OSS – Open Sound System)

play – play is tiny .WAV and some other native classical sounds formats with a beautiful ASCII art (text) equalizer

soxi – gives information on recorded sound stream header (info)

rec -r 8000 -c 1 record_microphone_input.wav

rec is unfortunately made to use the old and now obsolete /dev/dsp sound interface, so on many Linux distributions, recording sound with it might pose problems.

Another problem of rec is it usually records with a lot of noise, thus reducing the noise later with sox cmd is almost necessery, to mitigate the noise you will have to experiment with its options. For some better quality of recording use arg -r 22050.

A little shell script with plenty of example use cases of rec and post sox effect applied as synchronization record_and_normalize_from_mic_with_rec_and_sox_on_linux.sh is here

Generally I mentioned rec for historical reasons, nowadays it is quite obsolete so you probably better stick to the newer alsa native arecord.

2. Recording sound from microphone using alsa-utils arecord

alsa-utils package has bunch of tools to record, play and tune sound;

dpkg -L alsa-utils |grep -i /usr/bin/
/usr/bin/aplaymidi
/usr/bin/aplay
/usr/bin/aconnect
/usr/bin/amixer
/usr/bin/alsamixer
/usr/bin/aseqdump
/usr/bin/arecordmidi
/usr/bin/speaker-test
/usr/bin/iecset
/usr/bin/amidi
/usr/bin/aseqnet
/usr/bin/arecord

One of tools included arecord is able to capture sound from microphone. arecord, can record into .WAV, but as .WAVs are not compressed and most people prefer to save the input to some more wide recognized format as .MP3 it should be invoked in conjunction with lame;

arecord -D plughw:0,0 -f S16_LE -c1 -r22050 -t raw | lame -r -s 22.05 -m m -b 64 - mic-input.mp3


Writting this long and hard to remember command line and arguments is tough, so I created a tiny shell script wrapper which accepts as 1-st argument a file name and saves .WAV and converts it to .MP3. The script linux_record_from_microphone.sh is here

3. Recording from microphone input using ffmpeg

I've earlier blogged on how to use ffmpeg to capture Microphone sound here.

For those lazy to read my previous post the skele syntax is;

ffmpeg -f alsa -ac 2 -i pulse -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 -y myVOICE.wav 

To later convert WAV to MP3 use lame;

 lame -r -s 22.05 -m m -b 64 myVOICE.wav  mic-input.mp3

Saint Abraham the Bulgarian co-memoration in Bulgarian Orthodox Church

Monday, April 2nd, 2012

saint Abraham the Bulgarian, sv. Avramii Bolgarski

Saint Abraham the Bulgarian is an Orthodox Christian saint venerated across most Slavonic Christian dome. His co-memoration in the Bulgarian Orthodox Church (BPC) is on 1st of April.

What is unique about this saint is that he used to be born and grown in the tradition of the Muslim (Islam) faith and by the great providence of God he converted to the true faith of Christianity.

St. Abraham of (Bulgaria), was born in Volga Bulgaria in a community of Muslim Volga Bulgars (old Bulgarians). Nowdays Volga Bulgaria is located in Tararstan Russia. The saint used to be an islamic merchant and His martyrdom for Christ happened in March 6 (according to old Church Calendar) in year 1229.

He used to live in a very complex situation, when the islamic influence of Arabs in his motherland was quite severe. St. Abraham of Bulgaria used to be a rich man for his time, he was a merchant.
Because of the trade he travelled a lot to the Byzantine Empire and the Orthodox Christian principalities. This give him an opportunity to get to know Christian faith little by little.

He was accustomed to a wordly life but still always accepted strangers and similar to the Old Testamental father of nations st. Abraham he's been very hospitable to poor people.
By Gods grace he become convinced Muslim faith does not teach a true faith to the one God,  being pointed by God himself towards the right salvation way, he accepted Jesus Christ as a Lord and Saviour being baptized and hence converting to the truthful Christian faith.

His Christian baptizmal was accepted from Russian traders, who lived nearby the place of Great Bulgar.
Being baptized in the Christian faith Saint Abraham of Bulgaria not only confessed Christian faith across his fellow people, but he also led very harsh (ascetic like) life, wearing secretly below his clothes a heavy chains during his worldly travels. The profit he made from trade often he shared with the poor.Once he went for a trade to the city of Great (Bulgar) Bulgar. There he was arrested because there was a rumor, he cursed (islamic faith believed prophect) Mohammed and the muslim faith.


Saint Abraham Avramii Bylgarski Bulgarian Martyr saint old drawing

Muslims catched him and started convincing him to reject Christ, accusing him at a blasphemy. Abraham was not scared of muslim threats of expel and even putting to death. As Muslims failed to force him "by words" to convert back to Islam, they took him and put him in jail because of his denial of (their) Islamic faith.

In jail he was tortured but, they failed to convince him to deny Christ, seeing they have no way to convince him to accept Muslim faith once again, saint tormentors first cut his hands, then the legs and finally disgraced by his boldness and continues confession of Christ they beheaded him.

Soon afterwards the city of Bulgar was captured and burned down by the Mongols, many people in that time saw this is Gods punishment for the innocent shed blood of Abraham the Bulgar.
The local Christians took his body and buried him in the Christian cemetery of the ancient city of (Bolgar) / Bulgar.
On the place, where the saint was buried, a healing water spring emerged. The first man who received healing from this spring by Christ's grace was a muslim.

Miracle Making Spring Well Saint Abraham the Bulgarian

Great healing miracles happened on the saint grave. Local Christians took their relatives and bring them to the saints grave for a miracle healing and a prayer intercession of the saint. A rumour about the saints great graceous grave quickly spread and some people told about the miracle healing grave f st. Abraham to prince Georgi / (George) Vsevolodich.One year later again on 6th March 1230, the body of the saint was carried in the city of Vladimir, where the prince and his family, the Vladimirsk Bishop, the clergy and the local people received the holy relics of st. Abraham (of Bulgaria). The holy relics was kept in the local church "Dormition of Mother Mary" on 6th of March in the year of 1230.

The co-memoration of st. Abraham the Bulgarian is being observed in the Bulgarian Orthodox Church, since very ancient times.
Nowdays both Christians and Muslim celebrate the saints feast.

Icon of Orthodox Christian Saint Abraham of Bulgaria and his Holy Relics

Interesgingly, nowdays St. Abraham the Bulgarian is venerated as a saint by both Orthodox Christians and by Muslims. Many Muslims from Turkey and other muslim countries come each year for the saints feast day to pray and ask for healing or prayer intercession to God.

Even to this very day people receive by Jesus's grace through saint Abraham the Bulgarian's prayers – a various incurable disease healings. The healings occur on the same holy spring where the saint was buried. Many people are also healed from incurrable diseases through the veneration of the incorruptable saint holy relics kept in the Church Dormition of Mother Mary.