[openbeosmediakit] BSoundPlayer and other examples

  • From: "Marcus Overhagen" <dos4gw@xxxxxx>
  • To: openbeosmediakit@xxxxxxxxxxxxx
  • Date: Wed, 21 Nov 2001 15:52:41 +0000

What should we use to test our media kit development?
Simple answer, we use the existing applications!
CL Amp and SoundPlay should be able to work fine with our 
replacement. They only use basic MediaKit functionality.

For example, CL Amp. When you start it and drop an mp3 file, you will see the 
printed into the terminal:

libmedia.so: UNIMPLEMENTED BSoundPlayer::BSoundPlayer(const struct 
media_raw_audio_format *, const char * = 0, void (*)(void *,
 void *, long unsigned int, const struct media_raw_audio_format &) = 0, void 
(*)(void *, enum BSoundPlayer::sound_player_notification
 = 0, void * = 0)
libmedia.so: UNIMPLEMENTED status_t BSoundPlayer::Start()
libmedia.so: UNIMPLEMENTED void BSoundPlayer::SetHasData(bool)

This means that CL Amp is using a build in mp3 decoder, and uses a BSoundPlayer 
output it to soundcard.

When you drop an wav or aiff file, I calles BSoundFile related functions, 
this is the R3 API, that was replaced by BMediaFile & BMediaTrack in R4.

libmedia.so: UNIMPLEMENTED BSoundFile::BSoundFile(const struct entry_ref *, 
long unsigned int)
libmedia.so: UNIMPLEMENTED status_t BSoundFile::InitCheck() const
libmedia.so: UNIMPLEMENTED int32 BSoundFile::SamplingRate() const
libmedia.so: UNIMPLEMENTED int32 BSoundFile::CountChannels() const
libmedia.so: UNIMPLEMENTED int32 BSoundFile::SampleSize() const
libmedia.so: UNIMPLEMENTED off_t BSoundFile::CountFrames() const
libmedia.so: UNIMPLEMENTED BSoundFile::~BSoundFile() 

Let's ignore it until we have implemented BMediaFile & BMediaTrack,
so we can use them to emulate BSoundFile.

Same is SoundPlay, it uses BSoundPlayer for sound output,
and has build-in decoders (including the AMP decoder used 
to decode mp3). The build-in "Default Decoder" does use 
BSoundFile, while the build in "Media Kit decoder" uses
BMediaFile & BMediaTrack.

BTW, the application "CD Manager" that I wrote also uses BSoundPlayer,
BMediaFile & BMediaTrack.

The BeOS included MediaPlayer does use BMediaFile & BMediaTrack
to read files, but I don't know what it uses for sound output.
Same applies for "nplay".


Other related posts:

  • » [openbeosmediakit] BSoundPlayer and other examples