Discussion:
[Audiere-users] No sound :(
Sebastian Alff
2006-03-29 10:59:09 UTC
Permalink
Hi!

I just downloaded audiere and wrote a simple program based on the tutorial
from the doc directory.

AudioDevicePtr device = OpenDevice();
if (!device) {
Error();
}

OutputStreamPtr stream(OpenSound(device, "test.mp3", true));
if (!stream) {
Error();
}
stream->setRepeat(true);
stream->setVolume(1.0f);
stream->play();

I use GCC, link against the audiere.lib and the audiere.dll is in the
executable's directory. But unfortunately I hear nothing. Can someone help
me?

regards
-Sebastian
Matthias Gall
2006-03-29 18:36:12 UTC
Permalink
Hi Sebastian,

Sebastian Alff schrieb am Mittwoch, 29. März 2006 um 14:57:

SA> stream->setRepeat(true);
SA> stream->setVolume(1.0f);
SA> stream->play();

I guess the program terminates immediately after you call play. The
stream runs asynchronously, i.e. in a separate child thread. This
means that if you leave the main thread, the stream stops playing,
too.

Try something like

while( true )
{
// do nothing
}

after you call "play", or a

while( stream->isPlaying() )
...

in case you have a non-repeating sound.

By the way, your name sounds German; if you speak German, you may
have a look at this forum thread, where I answered exactly the same
question some days ago:
http://www.softgames.de/forum/viewtopic.php?t=118296

Kind regards,
Matt
--
Matthias Gall, lead programmer at sechsta sinn
mailto:***@sechsta-sinn.de
http://www.sechsta-sinn.de
Sebastian Alff
2006-03-30 13:22:05 UTC
Permalink
Hi!

You're right, I am German and that was exactly the problem. It works fine
now :).
Thanks a lot for your help
-Sebastian
Post by Matthias Gall
Hi Sebastian,
SA> stream->setRepeat(true);
SA> stream->setVolume(1.0f);
SA> stream->play();
I guess the program terminates immediately after you call play. The
stream runs asynchronously, i.e. in a separate child thread. This
means that if you leave the main thread, the stream stops playing,
too.
Try something like
while( true )
{
// do nothing
}
after you call "play", or a
while( stream->isPlaying() )
...
in case you have a non-repeating sound.
By the way, your name sounds German; if you speak German, you may
have a look at this forum thread, where I answered exactly the same
http://www.softgames.de/forum/viewtopic.php?t=118296
Kind regards,
Matt
Loading...