audiere and irrlicht
-
- Posts: 54
- Joined: Wed Oct 04, 2006 6:56 am
audiere and irrlicht
hello I don't know if it is the better location to post so.. sorry if bother. I'm trying to do an audiere an irrlitch integration but when i play 2 sounds at the same time one on them does not play.... can it be helped or it is because the library?
thanks
thanks
-
- Posts: 54
- Joined: Wed Oct 04, 2006 6:56 am
Weird i had no problems with Audiere. Have you opened one stream for each file?
Warchief's Warboard 3D Now hotseat release
-
- Posts: 54
- Joined: Wed Oct 04, 2006 6:56 am
No, i've opened only one stream. One for every one will be a lot of work for the pc, don't you think?... or if it is stored in memory it does consume memory or cpu?
UPDATE: I've tried to use a circular buffer and it works but... i think it overhead something
for(int p=0;p<10;p++){
sonidos[p]=audiere::OpenSound(sistemaSonido, "test.mp3", false);
UPDATE: I've tried to use a circular buffer and it works but... i think it overhead something
for(int p=0;p<10;p++){
sonidos[p]=audiere::OpenSound(sistemaSonido, "test.mp3", false);
I did not take care about freeing streams. Think audiere does it (as they are smart pointers).
But if you want to be sure, just register a callback.
Delete the stream when it stops.
But if you want to be sure, just register a callback.
Code: Select all
/**
* To listen for stream stopped events on a device, implement this interface
* and call registerStopCallback() on the device, passing your
* implementation. streamStopped() will be called whenever a stream on that
* device stops playback.
*
* WARNING: StopCallback is called from another thread. Make sure your
* callback is thread-safe.
*/
class StopCallback : public Callback {
protected:
~StopCallback() { }
public:
EventType ADR_CALL getType() { return ET_STOP; }
void ADR_CALL call(Event* event) {
streamStopped(static_cast<StopEvent*>(event));
}
/**
* Called when a stream has stopped.
*
* @param event Information pertaining to the event.
*/
ADR_METHOD(void) streamStopped(StopEvent* event) = 0;
};
typedef RefPtr<StopCallback> StopCallbackPtr;
Warchief's Warboard 3D Now hotseat release
-
- Posts: 54
- Joined: Wed Oct 04, 2006 6:56 am
The event has a member OutputStreamPtr StopEventImpl::m_stream that gives a pointer to the stream that stopped. You should only free that one.
Warchief's Warboard 3D Now hotseat release
-
- Posts: 54
- Joined: Wed Oct 04, 2006 6:56 am
It works, but you may find continuous allocations if you continue loading sounds. Just make sure you store the streams into a container and pick up from there. (For example, allow a maximum of 3 streams for the same sound).saulotmalo wrote:Thanks for the help, but in the game that i'm doing actually it runs well like i post before so.. il let it be. But i'll try to understant this way too.
thanks
@Blindside
I would prefer to go just with 1 library.
Warchief's Warboard 3D Now hotseat release
-
- Posts: 54
- Joined: Wed Oct 04, 2006 6:56 am