Page 1 of 1

custom audio streams / multichannel audio

Posted: Wed Jun 25, 2003 2:05 am
by mp303
First off, let me just say this: the latest update totally owns - in my honest opinion, it rips the heart out of any other basic compiler/editor systems, ever! :)

But I would like to once again bring up a topic that I brough up about six months ago: sound ... the sound library in PB is so extremely primitive, it's probably THE most primitive component in PB by now? ;)

So, the two features I would like:

1. Custom streams
2. Multichannel playback

The first is crucial for writing music applications - I know I'm not the only PB user who would like to write a tracker or synthesizer in PB, and because of the license restrictions, BASS or FMOD don't quite cut it ... a custom streaming system could be implemented with callbacks for filling the buffer and notifying the application of buffer underrun (CPU overload), and a couple of functions for starting/stopping custom streams, and for setting the samplerate/bitdepth/number of channels for the primary stream and custom streams...

The second is useful for game developers - currently, the previous explosion sample (for example) ends abruptly when you play the next one, since only one voice is allocated per sample ... you can work around this of course, but it's like reinventing the wheel every time - the number of voices could default to 1 for backwards compatibility, but dynamic voice allocation could be implemented simply with a setnumberofvoices command, or something similar...

...

I keep hoping that some improved sound features are one of the next items on the to-do list? :)

Posted: Wed Jun 25, 2003 3:13 am
by mp303
Oh yes, one other important thing, for custom streams - it would of course be necessary to have latency (buffersize / number of buffers) and driver settings customizable by commands, and output devices enumerable and selectable. You could already start to write music applications without these things being customizable, but they would need to be added eventually, since obtaining the lowest possible latency in a sound program that uses MIDI input during playback is always a must.

Oh well, a man can dream, can't he? :)

Posted: Fri Jun 27, 2003 12:29 pm
by mp303
doesn't look like I'm getting much feedback on this one ;)

Posted: Fri Jun 27, 2003 1:22 pm
by Fred
I agree for all of this and I will look how to manage it properly. All the sound are DX7 based for now and it seems you can't do multichannel with a same sound. My priority right now is the streaming of big sounds (ogg, wav, mp3 etc..) from disk or memory. Thanks for all the suggestions.

Posted: Sat Jun 28, 2003 12:52 pm
by mp303
hint: since you have to implement streaming anyways, you're only a short step from adding support for a custom callback to fill the buffers, which you'll obviously need some internal routine to do anyways ;)

Posted: Thu May 11, 2006 9:52 pm
by mp303
any development?

EDIT: wow, has it really been three years since I posted this? ;)

Posted: Fri May 12, 2006 1:28 pm
by josku_x
mp303 IMHO means My Pants are 3 years old, which have 0 hearts, but 3 stars :D

I guess you need to buy new pants for next year :shock:

Posted: Fri May 12, 2006 3:16 pm
by Joakim Christiansen
Well... I heard about this top secret flag in PlaySound(#snd,2) which would make it mutlichannel, but don't tell anyone!

Posted: Fri May 12, 2006 4:58 pm
by inc.
Regarding Audio streaming via dynamical refilling buffers: Do search in here for Avifil32_ext Userlibrary Thread in there I also posted the sourcecode in C.
Also you can use Directshow for streaming any format if the dshow audio codec is installed ...
http://msdn.microsoft.com/library/defau ... lecode.asp

Posted: Fri May 12, 2006 8:53 pm
by mp303
interesting, but ... now that I've heard that it may be possible to make VST plugins in PB, I find that a lot more exciting than just standalone audio applications! ;)