0
0

Hello ppl,
i’m using fmod library to create an mp3 player in c++ in combination with mfc.I’m having some problems though and i’d be grateful if anybody could help…

The first problem is a bit general.In my win2k system,even when i use winamp,the sound sometimes stops and i can only continue to play songs through windows media player.It’s kinda weird and it only happens on this one(it doesn’t happen on my win98 or winxp system).So,the same problem arises with the mp3 player i’m creating.The player works fine till some random time when it automatically stops to work and i have to reboot.Does anybody have an idea why this happens?

My second problem is about the callback routine of SetEndCallBack for when a stream stops to play.It works fine but there’s a problem.Since i’m using mfc,i have to make this an internal member function of my Dlg class,so that i have access to the member objects of the class( a CListBox etc..).As a matter of not having it this way,i cannot call the CListBox functions for example.I tried passing a pointer to it through the callback and the void* pointer.Then,i used static_cast to convert it to a class type,yet it seems that this conversion is not tolerant…So,if anybody can also help with that,it’be great…

Sorry for the long post and thanx for reading…

  • You must to post comments
0
0

[quote:1vnzpgv7]Passing an object pointer as a void * then casting it back to the class should work fine.[/quote:1vnzpgv7]

Yes,it works fine now… :roll: I thought that the void* pointer containing “this”(the pointer i pass to the callback) was the *buff one and it turned out to be the *param one.So,i did a cast on the *buff pointer that was NULL at the time ๐Ÿ˜ฎ And the program crashed.So,i decided to debug a bit and noticed that *buff was empty and *param contained a convincing stack value ๐Ÿ˜‰ So,it works ok now …

[quote:1vnzpgv7]So the problem is not fmod specific? Have you tried upgrading the sound card driver? [/quote:1vnzpgv7]

Well,i too thought that fmod does not have to do with that.However,whenever i use windows media player,the sound NEVER stops.Don’t really know why this happens,could be a sound card specific problem as you state…

Thanx for replying ๐Ÿ˜‰

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.