How to convert wav to mp3 (or ogg) on the fly?

Stef Bon stefbon at gmail.com
Fri Aug 24 06:20:31 PDT 2012


Hi,

I've written a cdrom reader FUSE filesystem.

Any client can read sectors in one of the audio tracks.
These audio tracks are read on demand, and only what is requested is
read, and written to
a file in the cache.

The files in the cache are pretty big (40-60 MB), so I want to try to
add the option to convert
the audio on the fly to mp3 or ogg files, which are not so big.

How can I do that using gstreamer? Thus:

now:

A. read startsector - endsector from cd
B. write to cached wav file
C. send a signal to a read command that sectors have become available
D. the read command reads the sectors

(my fs has an administration of sectors which are (not) read)

With de/encoding it will be:

A1. read startsector - endsector from cd
A2. decode/encode to desired format
B. write to cached file (thus a mp3 or a off file)
C. send a signal to a read command that sectors have become available
D. the read command reads the desired piece

Basically it comes down to decode/encode a fragment from a WAV file to
the right piece in the mp3/ogg file.

Stef


More information about the gstreamer-devel mailing list