Welcome, Guest. Please login or register.

Author Topic: mp3 playing on 68k  (Read 1552 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: mp3 playing on 68k
« on: April 27, 2004, 03:21:49 AM »
On 060 you should be able to get away with realtime decode at up to 44kHz...

The 040 struggles a bit. I found I could only play 22kHz mono on a 25MHz 040 (that was ages ago, however) if I wanted realtime playback.

I recall there was an mpega.library clone recently that used integer (fixed point) rather than floating point maths and is supposedly a fair amount faster on slower CPUs. Not totally sure, however.

Quote
thnx all, sorry for lame questions.


Bad pun ;-)

-edit-

Of course, if you want low overhead, high quality output, you could opt for one of those parallel port decoder things :-)
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: mp3 playing on 68k
« Reply #1 on: April 27, 2004, 01:02:54 PM »
Quote

kas1e wrote:
sorry all, but my problem is not a "what progs need to me for mp3 play ", but "how i can play mp3 on C". i mean - i try to write little program on sas-c for mp3 playing. i know, for it, i must use mpega.library, but mpega.library have only decode,etc fuction. i mean just decode, not playing. So:

#include
main(){
/* here i open mpega.library */
/* decode mp3 to raw ? */
/* what funcs in aos i must use for play my raw data ? */

so, my question "how i can play mp3 on sas-c". what fuction i must use, etc.

thanks agayn and sorry for poor enlish.



I've never used mpega.library, but it probably decodes data into a buffer you set up (perhaps arranged as pairs of WORD for stereo 16-bit etc.) with the decode function you mention. I expect you can specify the length of the buffer to use.

You need to be able to play this - if you look at the documentation for AHI, you will see it has a high level device interface that can play data arranged this way.

You can also set up a double buffer and AHI will keep playing from each alternate buffer. This allows you to fill one buffer while AHI is playing the alternate one. This is described in the AHI documentation.

Sorry for the lack of detail but I don't have the documentation to hand presently.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: mp3 playing on 68k
« Reply #2 on: April 27, 2004, 02:22:29 PM »
@Thomas

If you made a Process to run your example code in a loop using a pair of Semaphore protected memory buffers, you could even make your own double buffered routine and do the decoding in the main thread :-)

Not sure how efficient that would be compared to the genuine double buffered device IO approach. Probably a fair bit more overhead. But it would be a laugh :-D
int p; // A