Accessing audio pcm data?

BlitzMax Forums/BlitzMax Programming/Accessing audio pcm data?

jp22(Posted 2008) [#1]
Hi

Is there a way to access the PCM buffer which a channel is playing directly - Possibly not using OpenAL - as no drivers are found on my laptop! (think I may need to update Max via SVN..THe functionality is there via OpenAL 1.1 bmx commands, but no OpenAL driver exists... :-( ).

I understand that the vanilla libs don't allow this (LoadSound copies the PCM data to an internal buffer, which I can't get a pointer to - Unless I've missed something?). And work-arounds such as flipping between playing 2 channels isn't good as I can't control the latency between when I ask a channel to play and when it actually does, so perfect chaining of channels isn't possible (again, if I'm wrong here, please tell me!)

I don't care too much about knowing the current play position through a buffer, as I should be able to calculate this using a timer, but if I could just get a sound looping and then be able to write into it's buffer with new data, I'd be happy.

( If it is only possible with OpenAL, I'm still interested. But it's going to involve me having to work out how to get the driver installed...So any help there is also appreciated!)

Thanks in advance, guys and girls.

JP


GfK(Posted 2008) [#2]
Possibly not using OpenAL - as no drivers are found on my laptop! (think I may need to update Max via SVN..THe functionality is there via OpenAL 1.1 bmx commands, but no OpenAL driver exists... :-( ).
You have installed OpenAL, right?

If not, that's why it isn't working.

Download OpenAL Setup

Other downloads.


jp22(Posted 2008) [#3]
That'll be it :-)

Thanks for that. Wasn't sure where to download OpenAL from. Seems like it's all getting a little messy around here, with many support threads containing similar issues, but no actual docs that say the official line...

Even so, OpenAL's working, but I still can't seem to get to the PCM buffer data. Seems that alBufferData makes an internal copy of the PCM data you want to play (WHY?!)

So, if anyone has any further ideas...!

Thanks again
JP


jp22(Posted 2008) [#4]
Just for the record, I've got some code which now allows me to modify PCM data on the fly on the PC (using the waveOut* winmm commands).

If anyone's interested, I'll post it somewhere soonish.


Nikko(Posted 2008) [#5]
Yes post it, it will be interesting to check this out.