Author Topic: "Play" a stream  (Read 932 times)

yargon

  • Posts: 1
"Play" a stream
« on: 24 Aug '11 - 19:57 »
Hello friends developers,

I have a question, I am doing a shooting game, but I'm not sure how to implement when an explosion happens, because the explosion is always the same sound over and can occur in a short time, ie, the sound is not even ending and another explosion happens. My question is, how to "play" more than once in the same stream?

Thanks!

Ionut Cristea

  • Posts: 1545
Re: "Play" a stream
« Reply #1 on: 25 Aug '11 - 14:06 »
i suggest loading that file in memory and use BASS to play that audio data. Also a BASS_STREAM_AUTOFREE flag will be nice to have it on flags parameter from BASS_STreamCreateFile function.


Ionut

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: "Play" a stream
« Reply #2 on: 25 Aug '11 - 16:34 »
My question is, how to "play" more than once in the same stream?

Do you actually need to use a stream to play the sound, eg. for DSP/FX purposes? If not, you could replace it with a sample, eg. use BASS_SampleLoad instead of BASS_StreamCreateFile. A sample can be played multiple times simultaneously, by creating multiple playback channels for it via BASS_SampleGetChannel. Please see the documentation for details on that.