Posts tagged

Converting Audio Files on macOS for Renew Papyrus /
Renew Papyrus Solar-Powered Audio Player
Renew Papyrus Solar-Powered Audio Player

The Renew Papyrus is a solar-powered audio player for outreach ministry among oral cultures. It has internal memory preloaded with an audio Bible and can only be changed with a special USB kit. It also plays audio from SD cards, but the audio must be in Windows Media Audio 9 format (WMA9).

I’ve had two of these audio players around for a while. They were donated for ministry, but I’ve been unable to load them with WMA audio from my macOS computer and put them to good use. Nowadays, most people here use their mobile phones and MP3 audio files on micro SD cards.

A situation had me try to get the Papyrus audio players up and running. There are new Christians in an impoverished tea plantation asking for the Bible. One man in particular, kaka (“uncle”), is eager to learn more, but is illiterate and without a mobile phone to listen to recordings on his own. That was all the motivation I needed to learn how to make work what I had available.


WMA9 is backwards compatible with previous WMA formats (like WMA2), which is helpful because it is difficult to find WMA encoding software these days for macOS. The free and open-source software Audacity can export to WMA2. To do so it needs the optional FFmpeg library (details in the Audacity manual). Audacity is the easiest way to convert audio formats. It has been handy software for me to edit audio also. It can apply a “chain” of commands to multiple files, but unfortunately, there is no command available for chains to export to WMA.

I had a folder of Bible stories in MP3 format and a much larger folder of New Testament MP3 audio from Faith Comes By Hearing. The total number of files was about 300, too many to convert in Audacity one at a time. I had to work with FFmpeg directly.

The FFmpeg library can be used on the command-line (like in the Terminal application on macOS) to export multiple files or customize the export options beyond Audacity’s capabilities. Don’t be intimidated if the command-line is new territory! It can be done in just two or three lines.

Converting to WMA

I put all of the audio files into a temporary folder for simplicity, which I called “Audio to Convert” on my Desktop. I downloaded the static build of FFmpeg for macOS and put it in the same folder (there are more FFmpeg download options). I opened the Terminal app on macOS (look for it in “Applications” → “Utilities”). I then typed the following line to change the directory (cd) to this temporary folder (you’ll need to change the path to your folder, beginning with ~ for your home folder):

cd ~/Desktop/Audio\ to\ Convert/

Then I ran the following command to convert all MP3 files to WMA at the default export options (128kpbs) with metadata preserved. You will need to change ./ffmpeg to the path of the FFmpeg download if it is not in the same folder as the audio files as I had done:

for file in *.mp3; do ./ffmpeg -i "${file}"  "${file/.mp3/.wma}"; done

Now let it run. On my computer, to convert 300 files each of about 5 minutes in length, the process took about 5 minutes.

Look at the FFmpeg documentation for custom export options. For example, you can convert from other audio formats besides MP3, or change the bit rate from 128kbps down to something like 64kbps if the kind of audio is simple like speech and small file size is important.

Copying and Ordering the Files

The Renew Papyrus will only play audio files on SD cards that are within folders. It plays audio files in the order in which they were created, which is the order in which they are copied to the SD card. This is a problem if you copy all of the files at once. The files will not copy in order but smaller files will finish copying ahead of larger files. The play order will seem to be random.

You could copy the files one at a time (all 300 of them!), pausing between each one. You have to make sure the files copy in order, otherwise you’ll need to begin copying again from the point it went wrong.

Or use the following command in Terminal do it for you. Be sure you are still in the same folder as the audio files with the cd command above. And change what follows /Volumes/... to the name of the SD card and destination folder. It will copy a file every second (sleep 1), so this will also take 5 minutes for 300 files.

for file in *.wma; do cp "${file}" "/Volumes/SD/NT/"; sleep 1; done

When the files are copied, open the destination folder in Finder, sort by creation date, and double-check the order.

I can now play the converted WMA Bible stories and New Testament on the Renew Papyrus.

There is at least one person, an “uncle” in a nearby tea plantation, who will be happy to hear.


Jan 26, 2018
Added “Copying and Ordering the Files” section

Brett Terpstra, “Tagging files from the macOS command line” (Aug 22, 2017)

Apple System Fonts /

Update: Newer browsers use system-ui as a font name alias for the system font. For example, this will display “San Francisco” on macOS, “Segoe UI” on Windows, and “Roboto” on Android in supported browsers.

In CSS:

font-family: -apple-system, sans-serif;

There are other names to access the system font on older macOS versions (when it was OS X). See, for example, WordPress’s or GitHub’s CSS for a full stack of system fonts. For my use case — local Markdown preview and export — -apple-system is enough.

The San Francisco font family is versatile, having italics, all weights, small-caps, and a wide Unicode range.

There’s also other San Francisco fonts for watchOS that you can call in your CSS:

  • ".SF Compact"
  • ".SF Compact Rounded"
  • ".SF Compact Text"

Some of the fonts are available for download at the Apple Developer site.

Brett Terpstra, “Speedier file tagging in Mavericks” (Oct 27, 2013)

Installing Nepal Bible Society’s E-Bible on macOS and iOS /

The Nepal Bible Society (NBS) provides a digital version of their Nepali New Revised Version Bible (पवित्र बाइबल) (NRV) and Simple Nepali Bible (सरल नेपाली) (SN). NBS puts these together on a CD or USB flash drive called “E-Bible.” It’s available at their office in Kathmandu or at Christian bookstores like Ekta in Nepal and the Darjeeling District of India. The files could also be requested from NBS by email. Each Bible file is serial numbered, locked and licensed for individual use.

Other Nepali materials from NBS are also published in electronic form on the disk: New Testament Commentary (नयाँ करारको टिप्पनी), Bible Dictionary (बाइबल शब्दकोश) and Theological Topics: OT and NT Articles (शस्त्रका विषयहरू: पुरानो करार र नयाँ करारको लेखहरू). These files are not locked.

The software that NBS provides on the disk is made for Windows (BPBible) and some cell phones (GoBible). However, the actual files of the Nepali Bible resources are in a standard open format, SWORD, that can be opened in other software made for other operating systems, including macOS and iOS (iPhone, iPad and iPod Touch). The SWORD project is maintained by CrossWire Bible Society; they also maintain a list of compatible applications.

If you’re having trouble viewing Nepali (Devanagari) on macOS, see the fonts section in Nepali (Devanagari) Unicode Input for macOS.

NBS E-Bible Files

The Bibles and other materials come as archives (zip files) on the disk from NBS. The NRV and SN Bible files are in the “Bible Society Bibles” folder. The Commentary, Dictionary, OT Articles and NT Articles are archived together as one file in the “Nepali Commentary” folder. There are a few additional resources in the “Other Free English Resources” folder.


Installing on macOS

The recommended application for macOS is Eloquent (formerly MacSword). Download the latest release on GitHub. Move the app to your macOS Applications folder (/Applications).

The NBS E-Bible files will need to go into the folder /Users/<username>/Library/Application Support/Sword. The <username> is the name of your Home folder. The Library folder is your Home folder and hidden by default in recent versions of macOS. You can find Library while in Finder by clicking the “Go” menu and holding the “Alt” key. You can also go to the Sword folder directly by clicking the “Go” menu in Finder, then “Go to Folder…” and enter the path as above. If the Sword folder does not exist, enter the path above without “/Sword”. Then make the folder by going to the “File” menu (or right-clicking), selecting “New Folder” and naming it “Sword”.

Unzip each archive from the NBS disk that you want to add (double-click an archived file to open its contents). The files in each archive are in an order that needs to preserved. Take care to preserve the folder structure. There are two folders in each archive: mods.d and modules. Create these folders in the Sword folder if necessary. For each archive, drag its mods.d contents to the Sword mods.d folder, and likewise for modules.

Open the Eloquent application and you should see the modules listed. The Nepali New Revised Version and Simple Nepali Bibles are listed under “Biblical Texts” as “NRV” and “SN” respectively. Each will need to be unlocked before viewing. Right click each module and select “Unlock Module”, then enter the digital key that came with the Bible files.

Eloquent can download other modules (Bibles, Commentaries, Dictionaries, Books) through their automatic installer. See more information about using Eloquent.


Installing on iOS (iPhone, iPad and iPod Touch)

To install the Nepali Bibles on an iPhone, iPad or iPod Touch device, you will need to have both the device and a computer with the Bible files from Nepal Bible Society (see NBS E-Bible Files above) connected to the same Wi-Fi network.

Download the free iOS app from iTunes, PocketSword.

Open the PocketSword app on the device, click “More” and then “Preferences.” Turn on “Module Maintainer Mode.” Return to “More” then select “Downloads.” Click the small folder button in the top right to manage sources, then select “Module Maintainer Mode”. Note either the Bonjour or IP address.

On the computer, open a web browser and enter either the Bonjour or IP address as found in PocketSword’s “Module Maintainer Mode.” A page appears with a list of the installed modules and buttons to upload and install a module. Click the “Choose File” button. Select one of the zip files as it came from NBS and then “Submit.” You will need to upload and submit each zip file separately. Verify that the modules appear on the “Installed Modules” list at the top of the page.

In the PocketSword app, select “Bibles” and select the Nepali New Revised Version (NRV) and Simple Nepali (SN) Bibles in order to unlock them. A prompt will appear; select “Yes” and enter the digital key that came from NBS with the Bible files.


For other Nepali Bible digital resources, see Nepali Bibles Online.


Update 2019

Updated links.

Update 2017

The NBS Bibles — Nepali New Revised Version and Simple Nepali — are available on the mobile app YouVersion and it’s companion website, www.bible.com. The versions are called NNRV and सरल नेपाली, respectively. The YouVersion app allows downloading the texts for offline reading. The app is available for iOS, Android, Windows Phone and others.

Nepali (Devanagari) Unicode Input for macOS /

Unicode provides a universal character encoding so that scripts, even complex ones, can be viewed across all modern computers, platforms, programs, and languages.

Enabling Nepali Input

In macOS (or Mac OS X) There is a built-in keyboard for Nepali Devanagari input. See below for a “romanized” layout that is more natural for Westerners.

To enable Nepali input in macOS, go to “System Preferences,” then the preference pane for “Keyboard” (in older versions, “Language & Text” or “International”), then the “Input Sources” tab. Add (“+”) an input source, “Nepali.” You should select the optional checkbox “Show input menu in menu bar” to be able to change the language easily from the menu bar. When you turn on this menu, you can also enable the helpful “Keyboard Viewer” by going to “Keyboard” tab (in the “Keyboard” preference pane). Select the “Show viewers for keyboard, emoji, and symbols in menu bar” (in older versions, “Show Keyboard & Character Viewers in menu bar”). Now you can select Nepali from the menu bar icon. You can also select “Show keyboard viewer” from the same menu bar icon to see how Nepali Devanagari is mapped to your keyboard. You can click and insert Nepali characters from the viewer if necessary.

Adding a Nepali Phonetic Keyboard

A phonetic (“romanized”) layout is available to help Westerners (the ‘क’ is mapped to ‘k’, ‘ख’ to ‘shift + k’, etc.). Using the phonetic layout is a much more natural way to learn to type Nepali. To use the phonetic layout, download the zip file attached to this post. The phonetic keyboard layout is taken from http://suvash.github.io/nepali-romanized-pro/ but with the macOS default icon for Nepali and a small correction. This keyboard in turn is based on the standard set by the Kathmandu library, Madan Puraskar Pustakalaya.

Install the custom “Nepali – Phonetic” keyboard layout for macOS:

  1. Download and unzip the attachment. In it are two files: the layout and the icon for the menu bar.
  2. Move the two files into the “Keyboard Layouts” folder in the “Library” folder.
    • To make the layout accessible to all users on the computer, go to the root “Library” folder at /Library, or,
    • To make the new layout accessible only to the current user, move the files into the hidden “Library” folder of your home directory.
    • Find the hidden “Library” folder by opening Finder, holding the option key and clicking the “Go” menu; “Library” is listed there.
  3. A dialogue box may appear to authenticate the move; enter username and password of an administrator.
  4. You may need to log out and back in (or restart the computer) for changes to take effect.
  5. Now follow the directions above in “Enabling Nepali Input” and enable “Nepali – Phonetic” instead of “Nepali” as an input source in “System Preferences.” In newer systems, custom keyboards like this appear under “Other” in Input Sources.

Using the Nepali Keyboard

Change the input keyboard by selecting “Nepali” (or “Nepali – Phonetic”) from the menu bar icon. The keyboard shortcut is control + space. Select “Show keyboard viewer” in the menu bar icon to familiarize yourself with the layout (see directions above to enable it). You can see how pressing “shift” and “caps lock” affect the input. The Keyboard Viewer will float above other applications while it is open. If you have not enabled the menu bar option, you will have to change the keyboard layout to “Nepali – Phonetic” within System Preferences.

Devanagari and Nepali-Specific Fonts

Devanagari Unicode fonts are available on Mac systems. OS X 10.10 (Yosemite) and up uses “Kohinoor Devanagari” as its Devanagari default, and there is also “ITF Devanagari” and “Shree Devanagari 714.” Previous versions (10.2 and up), used “Devanagari MT” as the default and also had “Arial Unicode MS” as a fallback. The computer will use the default Devanagari font automatically when you select Nepali input and begin to type (if another Devanagari Unicode font is not already selected).

In older versions, the Asian language kit may need to be installed from installation disks. You will know that your computer needs this step if in place of Unicode text such as ‘नेपाली,’ there are only empty squares. The default browser, Safari, needs no special adjustment to view Unicode pages. Not every word processing application can handle complex Unicode scripts, like Devanagari conjuncts, or half-letters. Applications that are ready for complex Unicode scripts include TextEdit, Pages, Word (2016), OpenOffice and LibreOffice.

Devanagari is used for many South Asian languages. The Unicode fonts are not specific to Nepali, but are still acceptable for writing Nepali. Some differences between generic Devanagari and Nepali include the “झ” character and some numbers. Darjeeling-area Nepali uses the generic Devanagari characters, like Hindi. Devanagari Unicode fonts also include Sanskrit characters which are not used in Nepali writing. If you are looking for a Unicode font that has all the Devanagari variants specific to Nepali, see the Annapurna SIL Nepal font. There are also Nepali-specific Devanagari Unicode fonts at South Asia Language Resource Center.


Updates

  • 6/10/19: Corrected shortcut to change the input keyboard from ‘command + space’ to ‘control + space.’
  • 3/22/18: Updated link to original keyboard layout.
  • 11/13/17: Updated links to external sources and clarified the steps to install the phonetic keyboard.
  • 10/2/16: Updated directions for macOS Sierra and external links to source files and SIL Annapurna font page.
  • 8/17/15: Corrected keyboard layout (removed unnecessary space before ृ) and changed name from “Nepali Romanized” to “Nepali – Phonetic” to match system.
  • 12/11/14: Attached archive file of keyboard layout (from http://suvash.github.io/nepali-romanized-pro/) with default OS X menu icon for Nepali.
  • 12/3/14: Apple updated the default Devanagari fonts which work well for Nepali (see http://m10lmac.blogspot.com/2014/12/os-x–1010-yosemite-new-devanagari-fonts.html).