ebook2cw - convert ebooks to morse MP3s

Current version: 0.7.0 - June 3rd 2008 - See ChangeLog - Download directory

Windows GUI version: 2008-07-13


ebook2cw is a command line program (optional GUI available) which converts a plain text (ISO 8859-1 or UTF-8) ebook to morse code MP3 files. It works on several platforms, including Windows and Linux.

Parameters

A number of CW and MP3 parameters can be changed from their default values, by command line switches or a config file (see below). These are (default values in brackets):

Text commands

CW prosigns can be generated by enclosing arbitrary letters in angle brackets (e.g. <AR>, <SK>, ...).

The tone frequency (f), speed (w) and effective speed (e) can be changed arbitrarily within the text by inserting commands, starting with a pipe symbol, followed by the parameter to change and the value.

Example: |f400 changes the tone frequency to 400Hz, |w60 changes the speed to 60wpm.

Usage

ebook2cw has no graphical user interface itself, but a GUI interface is available as a separate program.

These explanations aim at Windows users since I asume that Linux users can adopt it more easily to their needs than the other way around.

To convert the ebook file "Book.txt", in which the chapters are separated by "Chapter n" to MP3 files, called "Book-n.mp3", at 40wpm, the following commands have to be entered in the Windows command prompt (Start -> Utilities -> Command prompt):

C:\test> ebook2cw.exe -w 40 -c Chapter -o Book- Book.txt
ebook2cw 0.6.2 - (c) 2008 by Fabian Kurz, DJ1YFK
Speed: 40 WpM, Freq: 600Hz, Chapter: >Chapter<, Encoding: ISO 8859-1

Initialized lame; samplerate=11025, bitrate=16, quality=5
Initializing CW buffers: dah_buf[991], dit_buf[329]

Starting Book-00.mp3
words: 10, minutes: 0
Finishing Book-00.mp3

Starting Book-01.mp3
words: 1312, minutes: 25
Finishing Book-01.mp3 

[...]

Total words: 4385, total time: 109 min

In this example everything takes place in C:\test\. It is assumed that ebook2cw.exe and the text file to convert are in this directory.

If you want to avoid using the command line, a simple batch file for Windows is available. If placed in the same directory, you can comfortably drag & drop a text file to ebook2cw.

Configuration File

As of version 0.7.0 (July 2008), ebook2cw can read a configuration file, ebook2cw.conf. In this file you can set all of the parameters which are available as command line parameters, to reduce typing work each time you use ebook2cw.

An example ebook2cw.conf with further explanations is available.

What is "ISO 8859-1" and "UTF-8"?

ISO 8859-1 and UTF-8 are different enconding formats for texts. ISO 8859-1 is a standard encoding of the Latin alphabet (limited to 256 different symbols), while UTF-8 can encode all Unicode characters, which includes the Cyrillic, Greek, Arabic alphabets, and a lot more.

If you are not sure about the encoding of your text: Most text in English and European languages will likely by encoded as ISO 8859-1, text which contains characters of different charsets will be UTF-8. If you try to convert a text with the wrong encoding, ebook2cw may produce some warnings about unknown characters.

Code tables

As of version 0.6.0 (February 2008), ebook2cw supports the full ISO 8859-1 charset (where mappings to CW symbols are applicable) and also UTF-8 (1- and 2-byte sequences). The latter so far includes most of the Latin characters, the Cyrillic, Greek, Hebrew and Arabic alphabets.

The available codes can be printed by ebook2cw with the -S command line option (see above), here is the output: UTF-8 - ISO 8859-1. I am grateful for any feedback and additions to the tables.

As of version 0.7.0 (July 2008), arbitrary character mappings can be defined. For example, you can automatically replace all accented characters or umlauts (e.g. á = .--.-, ä = .-.-) with more common characters (like a = .-).

This is done by map files separately for ISO8859-1 and UTF-8 coded texts. These map files must be specified in ebook2cw.conf, examples are available for ISO8859-1 and UTF-8.

Graphical User Interface

A simple graphical user interface for ebook2cw was was created with AutoIt. It is a separate program for Windows (runs under Wine on Linux) which needs to be in the same directory as ebook2cw.exe.

The program can be downloaded here. The interface is self explanatory, and it's possible to use most functions of ebook2cw with it.

Performance, Quality

The default settings (except the speed) are probably suitable for most people. A full hour of MP3 takes only 7MB, so depending on your speed, several books will fit even on cheap 1GB portable mp3 players.

The speed of the conversion mainly depends on your CPU speed; for example converting The War of the Worlds to MP3 at 60 WpM, resulting in almost 17 hours of MP3 took about 15 minutes on the author's 1.8GHz CPU.

Where to get ebooks?

Books are subject to different copyright laws in every country; there are several online archives with free (copyright expired or public domain in the respective country) ebooks, most notably:

User feedback indicates, that ebook2cw is also used to prepare morse courses lessons, generate morse versions of DX-newsletters, etc.

Here is a list of books that I already completed reading in CW.

I claim no credit for the original idea to convert books to morse. Other hams (like DL2KCD, K7QO, AC4FS, KY8D) have done this before me, but I disliked the idea of distribution as audio files, which largely limits flexibility and requires a lot of bandwidth. Instead, I decided to write a free piece of software with which everyone can create a CW audio book to his or her own liking.


Download, License

Of course ebook2cw is free software (free as in beer and free as in freedom) and published under the GPLv2.

The current version is 0.7.0 (July 3rd 2008) and can be obtained in several formats:

FormatLinkMaintainerRemarks
Windows EXE ebook2cw.exe- 
Windows EXEebook2cwgui.exe-(GUI only. Requires ebook2cw.exe)
Linux Binary ebook2cw- 
Source Code ebook2cw-0.7.0.tar.gz- 
Archlinux Packageebook2cw 0.7.0-1Bob, W9YA 

Author, Contact, Feedback

ebook2cw was written by Fabian Kurz, DJ1YFK.

I am always interested in any kind of feedback for my software. If you have any suggestions, questions, feature-requests etc., don't hesitate a minute and contact me via eMail or ICQ (169955833).


SVN access

All projects are also available via Subversion.

For those not familiar with SVN: You can always fetch the latest version by:

svn checkout svn://dl0tud.tu-dresden.de/yfk/             # whole repository
svn checkout svn://dl0tud.tu-dresden.de/yfk/qrq/         # only qrq
svn checkout svn://dl0tud.tu-dresden.de/yfk/yfklog/      # only yfklog  etc...

But be aware that this version may not be 'stable' at all. If you don't like experiments, just continue to use the normal releases.

I'll gladly grant write access to the repository as needed, just drop me a line.


Mailing list

For user support, announcements of new releases and general discussion, a mailing list has been set up. To subscribe or browse the archives, please visit this link.


fkurz.net -> Ham Radio -> ebook2cw
Last modified: Monday, 14-Jul-2008 23:54:23 CEST