Showing posts with label digital. Show all posts
Showing posts with label digital. Show all posts

Tuesday, March 23, 2010

Using Icedax and LAME to Rip Music CD

This short guide will help you rip a CD with a few command-line tools. Download the following files and put them in a folder, such as C:\WINDOWS.



Insert your music CD into the CD-ROM drive and open a command prompt (cmd.exe). First, run the following command to find your CD-ROM drive.


icedax -scanbus

The following command will display the contents of your CD:


icedax dev='D:' cddb=1 -J

The following command will save the second track as track2.wav:


icedax dev='D:' cddb=1 track=2 track2.wav

The following command will save each track as track##.wav:


for %i in (1 2 3 4 5 6 7 8 9 10) do icedax dev='D:' cddb=1 track=%i track%i.wav

For brief help on icedax command, type:


icedax -h


Using LAME to encode MP3 from .WAV files


LAME is a free MP3 encoder. I've written how to compile LAME in a previous post. The numerous options of LAME can be confusing to new users. After reading the output of lame --help, lame --preset help and lame --longhelp, I decided to go with one of the following presets and the -h option:



  • fm/radio/tape => 112kbps
  • hifi => 160kbps
  • cd => 192kbps
  • studio => 256kbps

The following is options related to ID3 tagging:


  ID3 tag options:
--tt <title> audio/song title (max 30 chars for version 1 tag)
--ta <artist> audio/song artist (max 30 chars for version 1 tag)
--tl <album> audio/song album (max 30 chars for version 1 tag)
--ty <year> audio/song year of issue (1 to 9999)
--tc <comment> user-defined text (max 30 chars for v1 tag, 28 for v1.1)
--tn <track[/total]> audio/song track number and (optionally) the total
number of tracks on the original recording. (track
and total each 1 to 255. just the track number
creates v1.1 tag, providing a total forces v2.0).
--tg <genre> audio/song genre (name or number in list)

Here's an example LAME command using my favorite preset hifi:


LAME --preset hifi -h --tt "House Party Remix" track3.wav PartyRemix.mp3

This converts track3.wav to PartyRemix.mp3 using ABR 160kbps hifi encoding.

Sunday, March 14, 2010

Korean short story: Death of a Prostitute

Death of a Prostitute is a Korean short story about a young prostitute found dead on a street. The ebook is written in Korean and meant for testing Korean on a digital reader supporting EPUB format.


Vietnamese Novel 'Thoi Xa Vang'

Thoi Xa Vang is a Vietnamese novel in EPUB format. It will work with Adobe Digital Editions, Nook and Sony digital reader.


Embedding Russian/Cyrillic/Unicode Fonts in EPUB books

I'd like to read Russian literature in its original language. So I downloaded Leo Tolstoy's Anna Karenina and put it in my Nook.


  1. The original format of the book was a Word document. I had to save it as text file and convert its character set from Windows Cyrillic (CP1251) to UTF-8 using Iconv.

    iconv -f CP1251 -t UTF-8 annakarenina.txt > annakarenina-u.txt


  2. I opened the text file with Sigil, formatted it and saved it as EPUB file.

  3. Put Unicode fonts in the EPUB file that have a cyrillic range. You can do so with 7-zip. I recommend Book Antiqua, MinionPro or DejaVu Serif.

    • antquab.ttf
    • antquabi.ttf
    • antquai.ttf
    • bkant.ttf


  4. Edit content.opf so that it has references to the fonts:

    <item id="font.bold" href="fonts/antquab.ttf" media-type="application/x-font-truetype"/>

    <item id="font.bolditalic" href="fonts/antquabi.ttf" media-type="application/x-font-truetype"/>

    <item id="font.italic" href="fonts/antquai.ttf" media-type="application/x-font-truetype"/>

    <item id="font.regular" href="fonts/bkant.ttf" media-type="application/x-font-truetype"/>

  5. Edit the stylesheet.

    @font-face {
    font-family: "Book Antiqua";
    font-weight: normal;
    font-style: normal;
    src: url(../fonts/bkant.ttf);
    }
    @font-face {
    font-family: "Book Antiqua";
    font-weight: normal;
    font-style: italic;
    src: url(../fonts/antquai.ttf);
    }
    @font-face {
    font-family: "Book Antiqua";
    font-weight: bold;
    font-style: normal;
    src: url(../fonts/antquab.ttf);
    }
    @font-face {
    font-family: "Book Antiqua";
    font-weight: bold;
    font-style: italic;
    src: url(../fonts/antquabi.ttf);
    }
    a {
    color: inherit;
    text-decoration: inherit;
    }
    em, i {
    font-family: "Book Antiqua", serif;
    font-weight: normal;
    font-style: italic;
    }
    strong, b, h1, h2, h3, h4, h5 {
    font-family: "Book Antiqua", serif;
    font-weight: bold;
    font-style: normal;
    }
    p {
    text-indent: 2em;
    margin-top: 0pt;
    margin-bottom: 0pt;
    }
    body {
    font-family: "Book Antiqua", serif;
    margin-left: 5pt;
    margin-right: 5pt;
    text-align: justify;
    }
    .sgc-1 {text-align: center}
    .sgc-2 {text-align: right}



To see how a Russian ebook might look on your Nook or any other reader, download and try my ebook Anna Karerina.

Wednesday, March 10, 2010

How to embed Unicode fonts in EPUB ebooks

I own a Barnes and Noble's Nook and recently had a trouble reading a Vietnamese novel on Nook. But I resolved the issue by hacking the EPUB ebook as explained below:



  1. Get the Unicode fonts that you want for your ebook. The following fonts come with Adobe Reader and cover enough Unicode ranges.
    • MyriadPro-Bold.otf
    • MyriadPro-It.otf
    • MyriadPro-Regular.otf

    With 7-zip, put the Unicode fonts in your ebook.
  2. Extract content.opf from your ebook and insert the following lines in the manifest section:
    <item href="MyriadPro-Bold.otf" id="embedded.font.bold" media-type="font/opentype"/>

    <item href="MyriadPro-It.otf" id="embedded.font.italic" media-type="font/opentype"/>

    <item href="MyriadPro-Regular.otf" id="embedded.font.regular" media-type="font/opentype"/>
    Put content.opt back into the ebook file.
  3. Extract stylesheet.css from the ebook and append the following contents:
    @font-face {
    font-family: "Myriad Pro";
    font-weight: normal;
    font-style: normal;
    src: url(MyriadPro-Regular.otf);
    }
    @font-face {
    font-family: "Myriad Pro";
    font-weight: normal;
    font-style: italic;
    src: url(MyriadPro-It.otf);
    }
    @font-face {
    font-family: "Myriad Pro";
    font-weight: bold;
    font-style: normal;
    src: url(MyriadPro-Bold.otf);
    }
    a {
    color: inherit;
    text-decoration: inherit;
    }
    em, i {
    font-family: "Myriad Pro", sans-serif;
    font-weight: normal;
    font-style: italic;
    }
    strong, b, h1, h2, h3, h4, h5 {
    font-family: "Myriad Pro", sans-serif;
    font-weight: bold;
    font-style: normal;
    }
    body {
    font-family: "Myriad Pro", sans-serif;
    margin-left: 5pt;
    margin-right: 5pt;
    text-align: justify;
    }
    p {
    text-indent: 2em;
    margin-top: 0pt;
    margin-bottom: 0pt;
    }
    Put stylesheet back in your ebook.
  4. Try and read your ebook with Adobe Digital Editions or your favorite ebook reader.

About This Blog

KBlog logo This blog is about current events and issues concerning general population. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

icon
Powered By Blogger