Riffmp3 encapsulates MP3 files to appear as .WAV files by adding
a RIFF/WAV header to standard MPEG Layer-3 audio files.
It was originally written to enable MP3 files to be played
by the Windows version of The Palace
multi-media chat client, which will only play sound files with a RIFF header.
However, these RIFF-encapsulated MP3 files enables MP3 sound files to be
used in other situations that only support .wav files or require sound
files to have a RIFF header, regardless of their filename extension.
The RIFF (Resource Interchange File Format) header marks the file as WAVE
data with the audio parameters as determined from header of the MP3 file.
The format tag specifies that the data should be handled by the
Fraunhofer MPEG Layer-3
Audio Codec, which must be installed on the computer running
the Palace Client.
See Audio Codec for MP3 for more
information about this codec.
Another limitation of the Windows Palace Client is that it will
not play audio files with more than about one megabyte of data.
The actual limit is close to 1,134,000 bytes. The Palace Client
seems to use the length of the data as specified in the RIFF header
as opposed to actual size of the file, itself. Unless directed
otherwise, riffmp3 limits the size specified in the RIFF
header but includes all of the actual MP3 data.
With this size limit, an MP3 file with a sample rate of 48 Kbits
per second can play a song about 3 minutes in length.
MP3 files with RIFF headers will play on most normal MP3 players
and media programs. They ignore the RIFF header and play the MP3
audio data in its entirety. Programs such as WinAmp, QuickTime
Player (on both Windows and Macintosh) and SoundApp (for Macintosh)
are examples of MP3 players that will play the full MP3 data.
One notable exception is the Microsoft Windows Media Player.
Although it will play MP3 files with the RIFF header, it uses
the same system codec as the Palace. Therefore it will only
play the amount of data specified in the RIFF header and ignore
the remaining MP3 data.
However, media file downloads of more than 1 MB are usually considered
too large for most Palace and other on-line usage.
So riffmp3 provides an option to truncate the MP3 data if you desire
to limit the actual size of the file.
Riffmp3 is a command-line program currently available
for the platforms listed below.
Compiled on Red Hat EL3
(should work on any x86 Linux)
ELF object file, Intel - (see below)
Compiled on Solaris 2.6, Sparc
Compiled on Solaris 9, Intel x86
Compiled on SunOS 4.1.4, Sparc
Compiled for 4.0.1, i386
Mac OS X
Compiled on PowerPC
(works on Intel up through 10.6)
Mac OS X
Compiled on Intel with 10.7 (Lion)
For Win95 / 98 / NT / 2000 / 2003 / XP / Vista / 2008 / 7
To download the program, select the version you want
and click "Download":
Your browser may automatically invoke the proper command
to unpack the software archive when it is downloaded.
For all the Unix flavors, including Mac OSX,
the downloaded file is in gzip'ed tar format.
Unpack the archive using the following command in a terminal window:
gunzip -c archive.tar.gz | tar xvf -
That will extract the readme file, riffmp3.txt, and the
executable program, riffmp3.
Note: The ELF object archive for Linux includes the object file,
riffmp3_elf_intel.o instead of an executable program.
For this you must complete the compilation of the program
using the following command to create the executable program:
gcc -o riffmp3 riffmp3_elf_intel.o
The MSDOS version is in ZIP format.
Use a program such as WinZip or PkUnzip to extract the readme file,
riffmp3.txt, and the executable program, riffmp3.exe.
Your DOS Command Prompt must be set up in "window" mode, not "dos"
mode, in order for the program to run.
This is a command-line only program. Even under Ms Windows or Mac OSX,
the program must be run in a terminal or command prompt window.
You type the name of the command, riffmp3, followed by one
or more options and file names.
The command format for riffmp3 is:
riffmp3 [options] file.mp3 [more MP3 files]
file.mp3 is the name of the MP3 file to be processed.
It doesn't require the ".mp3" extension.
More than one MP3 file may be listed on the command line
to be processed.
You can specify multiple files using wilcards (e.g. *.mp3).
There are several options for the program that
modify its behavior in various ways.
If no options and no MP3 file is specified the program will
display a usage summary.
The options are divided into four catagories.
These options control the name of the output file(s):
Specify a directory name to put the converted output files.
Replace the MP3 file(s) with the new RIFF file(s).
The original files(s) are renamed with a ".mpo" extension.
Specify the exact name for a single output file.
This should only be used for a single MP3 input file.
If neither -d, -r or -o are used,
the output file(s) are named as the original file(s) but
with a ".mpr" extension (e.g. song.mp3 becomes song.mpr).
When -d is used, the new file(s) will be named the same
as the original file(s) but in the specified directory.
These options control the data for the output file(s):
Limit size (in bytes) specified in the RIFF header.
The default is 1134000. You may have to use a slightly lower
limit for some files to work. A value of 1131000 works better.
Specifying a value of 0 disables the size limit which is useful
for applications other that the Palace.
Limit output file size to RIFF data size.
This option truncates the actual size of the output file(s).
Warning: it can cause the file not to work in palace.
The following options provide a way to specify parameters if
they cannot be determined from the original MP3 file or if
you want to experiment with various values:
Specify the MP3 bit rate in K-bits per second.
Specify the MP3 sample rate in samples per second.
Specify the number of audio channels (1 or 2).
Do not try to decode the MP3 header.
The -h option is provided for cases when the program finds
errors in the MP3 file that cause it to reject the file.
It is possible that if you specify the required parameters, the
RIFF encoded file will work.
And finally this general option:
Verbose - display information for each MP3 file.
Without this option, riffmp3 works silently except to report errors
and warnings about reaching the RIFF size limit.
The first example will add a RIFF header to the file, mysong.mp3,
and the new file will be named mysong.mpr:
The next example will add a RIFF headers to the files, song1.mp3
The new files will be named song1.mp3 and song2.mp3 and the
original files will be renamed song1.mpo and song2.mpo:
riffmp3 -r song1.mp3 song2.mp3
This last example will add RIFF headers to all the MP3
files in the current directory, placing the new files in the
directory named "riffed" and display the MP3 parameters and
To play MP3 files from your palace server you need to have the
files available for downloading to users' clients in your server's
Then, for each file, have a script in a handler such as ON SELECT,
or ON ENTER with the command:
For the Windows Palace Client to play the downloaded files
see our Windows MP3 page.
For the Macintosh Palace Client to play the downloaded files
see our Macintosh Media page.
For Palace Viewer users it is necessary to use a NETGOTO command
in your script and the user must have their WEB browser configured
to handle MP3 files with an MP3 player (preferably not the Windows
Media Player for reasons mentioned above).
You server's script will need a little more work to handle
TPV users as well as stand-alone client users.
The example, below, should work nicely after you insert your
actual ULR where it says "fileserver_url".