Friday, March 26, 2010

TTS (Text-to-Speech) Using Linux

Okey... TTS or Text to Speech is the system converts normal language text into speech. Speech synthesis is the artificial production of human speech. A computer system used for this purpose is called a speech synthesizer, and can be implemented in software or hardware

This Schema of TTS generally :

File:Festival TTS Telugu.jpg
for more information about TTS u can go to http://en.wikipedia.org/wiki/Speech_synthesis
Now at least we know how text can be converted to voice.

Let's Rock n Roll On LINUX
actually, you can use any LINUX Distro and I Use CENTOS 5.2 to implement TTS
here we go...
if you have install linux on your PC, you can go now to try TTS but if you have not install yet. i will wait you :P hehehe......
Okey....Now We install dependencies of TTS using gnome-terminal or shell (run as root)


1. yum install festival (for REDHAT-Based) / apt-get install festival (for Debian-Based)
festival is the speech synthesizer that developed by The University of Edinburgh


2. yum install text2wave (for REDHAT-Based) / apt-get install text2wave (for Debian-Based)
taxe2wave is text to wav converter based-on festival voice

3. Install lame :
- wget http://nchc.dl.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz
- tar xvfz lame-3.98.4.tar.gz
- cd lame-3.98.4
- ./configure --prefix=/usr
- make
- make install
lame is wav to mp3 converter :D
4. Install PHP and Web Server (Optional: Just if you want to make a TTS Web-Based)
- yum install php5 httpd (for REDHAT-Based) / apt-get install php5 httpd (for Debian-Based)
PHP and Web Server for create web-based TTS



Now test festival running or not

$ echo hello world festival --tts (you will hear "Hello World")

$ nano myspeech.txt (write everything you wanna say)

$ festival --tts myspeech.txt (you will hear everything you wanna say)



Test text2wav

$text2wave myspeech.txt -o myspeech.wav (Now you will get wav file from text2wave )



Test lame

$lame myspeech.wav myspeech.mp3 (and you get mp3 file from lame you can play using totem in linux)



Okey....actually it's over if we just talking how can we convert text to audio file but if we want to try explore.

I will give u a simple source code for PHP front-end below


< html >
< body >
< form method="POST" >
< textarea name="text" cols="70" > < /textarea > < br / >
< input type="submit" >
< /form >
< ?php
error_reporting ( E_ALL );
ini_set ( 'display_errors', True );
if ( isset ( $_REQUEST['text'] ) ) {

//Directory OF WAV FILE
$wavfile = "wav/".time().".wav";

//Directory Of WWW file default is /var/www
$wwwDir = '/var/www/voice/';
2
//Directory of mp3 file
$mp3file = "mp3/".time().".wav";

// convert text 2 wav
exec ( 'echo "'. escapeshellarg ( utf8_decode ( $_REQUEST['text'] ) ) . '" | text2wave -o ' . $wwwDir . $wavfile );

// convert wav to mp3
exec ( "lame '".$wavfile."' '".$mp3file."'" );
? >
< p > The File is < a href="
< ?php
echo $speechfile;
? > " > Here< a > < /p >
< ?php
}
? >
< /body >
< /html >

Oke See ya..... I hope can help you





Monday, February 1, 2010

Build your own SMS gateway with Ubuntu Linux and Gammu

Some time ago I went down the path of building a simple sms gateway. At the time I wrote a basic blog entry but received numerous requests for a more detailed "how-to"... so here it is.

I based my solution around a basic linux (Ubuntu) server - the machine itself is nothing fancy but is more than capable of handling the sort of load it's getting. The device being used to send/receive SMS messages is an "old" Nokia mobile phone that I have since retired from use as a handset.


The specs of all components I used are listed below - all up you should be able to purchase these items for less than $50 (or you may have the majority of them lying around).

Computer: IBM GL300 - Celeron 366, 128Mb RAM, 30Gb HDD
Phone: Nokia 7200
Cable: Nokia "Type CA-42" (this will vary depending on your phone, basically it's a usb to phone cable)
Software: Ubuntu Server (I used the "edgy" release) and Gammu (the part that does all the work)

Optional: USB Phone charger - this makes things easier than having to find somewhere to plug in another power adapter and is also much more energy efficient :)


Please note: I am assuming some basic linux familiarity with this tutorial - if nothing else the ability to use a command-line editor such as vim to edit text files is required. I have tried to keep all the language simplified to make this tutorial suitable for people of all skill levels.
Step 1 - INSTALL UBUNTU

The first step is to install ubuntu (server) on you machine. You can install the desktop (client) release if you prefer - although if you're doing so I woul recommend a higher-spec machine. As I am using this machine strictly as a server (all access will be done remotely once the initial install is complete) I had no need for a GUI or additional applications.

Run through the setup and answer all the questions - they should all be fairly straight-forward, and if you get stuck the defaults are usually what are worth using.

The only point to ensure you do is select that you want to run it as a LAMP (Linux, Apache, MySQL, PHP) server.
Step 2 - Remote Access

Once the install is complete and the server rebooted, I like to install ssh so that I can complete the process from the comfort of my study (rather than coping with the noise from a rack full of machines). This is done with the following command:

sudo apt-get install ssh

Once this is done you can complete the process remotely using an ssh client (in my case PuTTY) - of course you can always sit with your server and do it all locally - whatever you prefer.
Step 3 - Update and Upgrade/Patch the server

I like to get things up to date and patch them before going any further (much like I would do with any other Operating System). Before running an update (to find out what is available) and an upgrade (to implement the upgrades) using apt-get, the /etc/apt/sources.list file needs to be modified to ensure that all universe and backport repositries are made available (this will make sense when you see the file).

Once you have made the changes to /etc/apt/sources.list, use the following commands to update and upgrade your server:

sudo apt-get update
sudo apt-get upgrade

Step 4 - Install Gammu

Installing gammu is surprisingly easy (once again thanks to the wonders of apt-get), just use the following command:

sudo apt-get install gammu

Hard wasn't it? ;)

OK now it's time to plug your phone in and see if we can get things talking. With the phone connected, type the following command:

lsusb

you should now see your phone listed as a device - for example:

Bus 001 Device 002: ID 0421:0802 Nokia Mobile Phones

if not - make sure your cables and power are all good and try again.

The gammu installation comes with some example configuration files which are worth using as a starting point - if nothing else they help you to understand how gammu can be configured so that you can tailor a solution for your needs. These are located in /usr/share/doc/gammu/examples (in gZip archives).

Copy the gammurc file to /etc/gammurc :

sudo cp /usr/share/doc/gammu/examples/config/gammurc /etc/gammurc

Now edit /etc/gammurc to specify your port and connection type (this will vary based upon where/how you have things plugged in and what sort of cable/interface your phone is using). The settings for mine are:

port = /dev/ttyACM0
connection = dku5

Save this config and from the shell type:

gammu --identify

you should now be presented with some information regaqrding your phone such as:

Manufacturer : Nokia
Model : 7200 (RH-23)
Firmware : 3.110 T (18-03-04)
Hardware : 0903
IMEI : 353363000813894
Original IMEI : 353363/00/081389/4
Manufactured : 04/2004
Product code : 0514143
UEM : 16

If this is the case then you have got gammu up and running and can send yourself a test message with the following command:

echo "boo" | gammu --sendsms TEXT [recipient mobile number]

That's it for the basic creation of your own private SMS gateway - I'll post a followup article which details how to integrate gammu with MySQL and also discuss creating a PHP front-end for it (these are the reasons the LAMP components were installed).A challenge plays!.

Thursday, June 25, 2009

Delete Dual Partitions Grub Error 22, FIXMBR

Hoaaaaaaaaaahhhh....... So speepy .... overnight because of install dualboot OS windows and linux in my Friend PC.... ckckckckc..... after trying to install Linux 3 times but i still got error.... ckckckckckck... i used PC with prosessor intel dualcore ram 512 mb swap 1,5 gb vga nvidia os 1 windows xp sp2 os 2 PCLINUX3d ckckckckc .......it isnt running very well..............damn!!...... i think this computer need more RAM i have trying to install untill 7 PM but finally i boot using XP and delete all Linux Partition i hope i can boot directly into XP But it turn outs .............
OH...DAMN !!!...............
ckckckckckckckckck

I got error like this :
GRUB 1.5

Error 22

Ya...Allaah...
i forgot if i delete a Linux the grub is not exist any more..........
oke
i immediately took my CD XP
and boot use XP
then enter menu Install XP

i choose R to repair

then choose no 1
then i retype password of admin pc
then type FIXMBR
finish .......
i can directly boot from PC to XP
ahehehehehehe :D
hoaaaaa......
Sleepy

Monday, June 15, 2009

Keindahan Yang Terlupakan itu.................. (The beauty of The Forgotten, that is.........)

"Sebuah hasrat yang telah lama terpendam memandanginya dengan penuh rasa cinta melihatnya bagaikan setangkai bunga yang tak pernah layu dan warnanya begitu indah dan indah tapi mengapa kau terlupakan.........."

Sebuah cerita yang telah tertulis dengan pena biru, begitu lama baru aku menyadari kehadiran mu yang selama ini begitu dekat dengan aku...........
Aku sungguh hanya manusia bodoh yang telah mengganggap mu begitu tak berguna dan tak patut dilihat, kini semua telah berubah ..........
Aku menyesal dan sungguh menyesal kenapa semua ini terjadi? mengapa harus aku yang mengalami .............................
Apa karena Kau yang menyangka aku yang sanggup menjalaninya ?.............
Semua telah terjadi telah membentuk cetak biru haru dalam hatiku..............
Semua yang terjadi telah membuat ku tersadar dari mimpiku yang panjang.
Mimpi seorang yang gila dan tak paham akan arti cinta sesungguhnya.......
Arti dari Cinta yang terkadang sulit untuk dimengerti bahkan dipahami ..............
Ketika makna terisat tak lagi mudah dipahami dan dimengerti ..............
Ketika makna tersurat yang mudah dipahami namun salah terarti............
Cinta sejati takkan datang dengan sepenuh hati...........
Aku kini telah mengerti hal yang telah lama salah terarti...........
Cerita ini adalah puisi hina yang tersadur dari jalan luka
Cerita antara Tinggi dan rendah hati
Cerita antara Kaya dan miskin hati
Cerita antara kami , kamu dan aku yang tak pernah bisa saling mengerti karena aku terlalu.......
Sekarang kau telah hilang dalam hidupku ..........
Hidup yang telah begitu terlihat indah namun hampa
sekarang aku akan berusaha untuk mengerti bahwa......
"Sesungguhnya Keindahan yang Terlupakan Itu Adalah Cinta Sesunguhnya.
"

Basic Configuration of Cisco Catalyst

First Open hyperterm (Windows) with press START > ALL PROGRAM >ACCESSORISS > COMMUNICATION > HYPERTERM (for win XP).
for Linux use minicom as hyperterm.

hyperterm
give name for new hyper file as "coba"
then choose com port that will be used "com1"
and then for Catalyst use default bit.
Before you enter to config cisco product, in Cisco we have 3 mode of Config there are :
A. User Mode marked with ">" then name of switch ex: Paskib99>
B. Privillage Mode marked with "#"
c. Global Configuration Mode marked with "(config)#"

Basic Commands Of Cisco :

1. Giving Nama of Switch
Catalyst>enable (this is UserMode)
Catalyst# (this is PrivillageMode)
Catalyst#Hostname Pasis99 (nama of Switch ex: Pasis99)
Pasis99#

Ok ......... sukses you have successfully changed the name of the Catalyst switches into Paskib99 :D

2. Assign IP of Switch
Pasis99#conf t
Pasis99(config)# (this is GlobalConfigurationMode)
Pasis99(config)#interface vlan1 (the default VLAN port)
Pasis99(config-if)#ip address 10.2.2.2 255.0.0.0
Pasis99(config-if)#no shutdown (to interface on or standby)
Pasis99(config-if)#end
Pasis99#write memory (to save configuration )

Ok ....... now the switch already have ip address on interface vlan1 : 10.2.2.2 netmask 255.0.0.0

3. Giving some description in some Interface
Pasis99#conf t
Pasis99(config)#interface vlan1 (choose the interface you want to be given a description)
Pasis99(config-if)#description port for Vlan 10.2.0.0
Pasis99(config-if#end
Pasis99#wr mem

ok......that is mean vlan1 with description for VLAN 10.2.0.0

4. Creating secret password
Pasis99#conf t
Pasis99(config)#enable secret 0/5 (choose 0 if not be encrypted and 5 reverse) culun (your password ex :culun)
Pasis99(config)#end
Pasis99#wr mem (save config)

ok......you have made a secret password that is 'culun'

4. Creating enable password
Pasis99#conf t
Pasis99(config)#enable password paskib99
Pasis99(config)#end
Pasis99#wr mem

ok......you have made a secret password that is 'paskib99'
enable password is the password for you who want to make the shift from user mode to the mode privilage whereas
secret password is the password that will be using that klo one wants to go to cisco from the outside!

5. Activing telnet funcion for Cisco
Pasis99#conf t
Pasis99(config)#line vty 0 4 (enter into vitual terminal line)
Pasis99(config-line)#password gaktau (giving password so not to directly enter without authentication)
Pasis99(config-line)#login
Pasis99(config)#line vty 4 15 (enter into vitual terminal line)
Pasis99(config-line)#password gaktau (giving password so not to directly enter without authentication)
Pasis99(config-line)#login
Pasis99(config-line)#end
Pasis99#wr mem

Finish you have to telnet your switch ....OK

6. Enable Passowr Encryption
Pasis99#conf t
Pasis99(config)#service password-encryption
Pasis99(config)#end
Pasis99#wr mem

now no one will ever know your password ... ok!

7. Giving default gateway
Pasis99#conf t
Pasis99(config)#ip default-gateway 10.2.0.1 (ip router that u use)
Pasis99(config)#end
Pasis99#wr mem

Finish... you have created a well-cisco config ........:D
thus when you try to do a 'show running configuration' will display all the commands that you have invested in catalyst

Pasis99#show run
Building configuration...

Current configuration : 1204 bytes
!
version 12.2

service timestamps debug uptime
service timestamps log uptime
service password-encryption
!
hostname Paskis99
!
enable secret 5 $thtghadgfig/524784hjfbug
enable password $f$dh$dxgjh/gvyu90767
!
!
!
!
!
vlan internal allocation policy ascending
!
interface FastEthernet0
no ip address
shutdown
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface GigabitEthernet0/3
!
interface GigabitEthernet0/4
!
interface GigabitEthernet0/5
!
interface GigabitEthernet0/6
!
interface GigabitEthernet0/7
!
interface GigabitEthernet0/8
!
interface GigabitEthernet0/9
!
interface GigabitEthernet0/10
!
interface GigabitEthernet0/11
!
interface GigabitEthernet0/12
!
interface GigabitEthernet0/13
!
interface GigabitEthernet0/14
!
interface GigabitEthernet0/15
!
interface GigabitEthernet0/16
!
interface GigabitEthernet0/17
!
interface GigabitEthernet0/18
!
interface GigabitEthernet0/19
!
interface GigabitEthernet0/20
!
interface GigabitEthernet0/21
!
interface GigabitEthernet0/22
!
interface GigabitEthernet0/23
!
interface GigabitEthernet0/24
!
interface GigabitEthernet0/25
!
interface GigabitEthernet0/26
!
interface GigabitEthernet0/27
!
interface GigabitEthernet0/28
!
interface TenGigabitEthernet0/1
!
interface TenGigabitEthernet0/2
!
interface Vlan1
ip address 10.2.0.1 255.255.255.0
!
ip default-gateway 10.2.0.1
!
!
control-plane
!
!
line con 0
line vty 0 4
password $f$dh$dxgjh/gvyu90767
login
line vty 5 15
password $f$dh$dxgjh/gvyu90767
login
!
end

Pasis99#



easy from cisco is if there is one command that you do not want to delete it just add "no + commands that you do not like"
example of the "no ip default-gateway 10.2.0.1", "no service password-encyption" etc.

Wednesday, June 10, 2009

Format and Mounting New Hard disk on Linux


Ckckckckckckck.....
Installation new harddisk broo..........
ckckckc..........
i cant guess that i must install new harddisk, because today i've run out of My disk space damn !!
ckckckckck
ok ...
let's see....(here i use UBUNTU 8.10 )

command line mode : ON


$ df -H (for see space of disk broo...)
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 19G 16.8G 2.2G 89% /
tmpfs 127M 0 127M 0% /lib/init/rw
varrun 127M 103k 127M 1% /var/run
varlock 127M 0 127M 0% /var/lock
udev 127M 2.8M 124M 3% /dev
tmpfs 127M 0 127M 0% /dev/shm
lrm 127M 2.1M 125M 2% /lib/modules/2.6.27-7-generic/volatile

$ su - root (become root ya...accidental hard drive already installed so there isn't need turn off the computer hehehe..... i use hardisk maxtor IDE 160gb)
password:******(usual enter root password)

# fdisk -l (to see my hard drive already signed or have not)
Disk /dev/sda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x473432c2

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2327 18691596 83 Linux
/dev/sda2 2328 2434 859477+ 5 Extended
/dev/sda5 2328 2434 859446 82 Linux swap / Solaris

Disk /dev/sdb: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table
(wah already signed but cos of new harddrive you will see like that ya.....)

# fdisk /dev/sdb (this for create partition on your new hard drive....)
The number of cylinders for this disk is set to 2434.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): m (press m for help)
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n
( n for new partition ok! than press enter 2 times ok..... finish now we have new partition .........)

# fdisk -l
Disk /dev/sda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x473432c2

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2327 18691596 83 Linux
/dev/sda2 2328 2434 859477+ 5 Extended
/dev/sda5 2328 2434 859446 82 Linux swap / Solaris

Disk /dev/sdb: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 19452 18691596 83 Linux
(already signed new partition hehehehehe ...... next broo)

# mkfs.ext3 /dev/sdb1 (format hardisk till finish using type ext3 (not NTFS windows ya)

# mkdir /mnt/disk-2 (create new folder to new mount disk hihiihihihi delight :) )

# mount -t ext3 /dev/sdb1 /mnt/disk-2 (mount new disk so that could be used.... hehehehe)

# df -H (check again brooo.....)
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 19G 16.8G 2.2G 89% /
tmpfs 127M 0 127M 0% /lib/init/rw
varrun 127M 103k 127M 1% /var/run
varlock 127M 0 127M 0% /var/lock
udev 127M 2.8M 124M 3% /dev
tmpfs 127M 0 127M 0% /dev/shm
lrm 127M 2.1M 125M 2% /lib/modules/2.6.27-7-generic/volatile
/dev/sdb1 160G 0 160G 100% /mnt/disk-2 (already enter broo....)

# vi /etc/fstab (to create permanent disk so don't have to be mounted again when you restart your computer)

# /etc/fstab: static file system information.
proc /proc proc defaults 0 0
/dev/sda1 / ext3 relatime,errors=remount-ro 0 1
/dev/sda5 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
(tambahin dimari boss)
/dev/sdb1 /mnt/disk-2 ext3 defaults 1 3
(terus tekan ESC dan ketik :wq! untuk simpan ok.....selesai bozzz.......)


Alhamdulillah i have done......

Easy Way to Create E-Learning Video


For you who are / want to create E-learning video than Upload that to your own website or wanna upload to YOUTUBE or YOUTUBE-Alike hehehe.....
This is cool software here....
The Name is Screen VidShot have been made bygeovid. so you don't need to bother with windows media encoder to record which eat all your computer resource if u use that hehehehe............

Oke here is the Example video.....







if u want to download .....
this below.....
Genuine site (Trial)
Mirror Site