On Tue, Feb 26, 2002 at 06:44:32PM +0100, Guenther Sohler wrote: > * puts pcm data into an array piecewice(eg convert 1000 samples at a time)
MAD decodes to pcm samples, it's up to you to 'take' the nr of samples you need each time. > * somehow gets the mp3 stream You can give the decoder a mmap()'d area with encoded bytes, so basically an array with your mp3 data. > * need to seek to any position in time (in mp3 file) There are various methods of doing this, if you need absolute sample accurate seek the most reliable method is to first determine the mpeg frame positions (i.e. parse the whole mp3 file beforehand). > * simple c code example I wouldn't call the alsaplayer mad plugin simple but it does everything you want. The mad_play_frame() call will return a fixed amount of pcm samples per call. the seek function is also pretty much sample accurate() (since reverse play works flawlessly). > I looked into MAD, but id drove me MAD because there is no sample code for > low-level application Yes there is, just not in the MAD distribution :) Good luck, Andy
