record with OpenAL

BlitzMax Forums/BlitzMax Programming/record with OpenAL

Vignoli(Posted 2007) [#1]
Hello !

I would like to know if there is a simple tutorial to record a sound in a buffer with OpenAL with Bmax.

I've found a tutorial in C++ on the web but nothing in Bmax.


Vignoli(Posted 2007) [#2]
Thanks a lot......................


iprice(Posted 2007) [#3]
There isn't. Satisfied?


Vignoli(Posted 2007) [#4]
Thanks again !!


Vignoli(Posted 2007) [#5]
Ok, no support for Bmax, i've lost my money... "je change de crèmerie !"


LarsG(Posted 2007) [#6]
Is OpenAL fully wrapped in a BMax module?


Tom(Posted 2007) [#7]
I'll have max next week some time, I'll be porting my B3D openal code/knowledge over to max.


Vignoli(Posted 2007) [#8]
I don't understand your question, LarsG. Sorry.
(I'm from Corsica and my english speaking is poor)

My problem is simple : I'm working on A.I systems, and i must do some experiences sometime.
So, now, i try to make communicate two computers ( one with windows, one with linux) with a very simplified system via microphones and speakers. (like a human can do with ears and mouth)

When one of the computer will need to talk (with squares wav files), the other will have to recognise the frequency, etc...

This is not so hard but i can't record anything with Bmax for now.

A little help will be very appreciated.
If nothing is possible at this time, thanks to tell me it.


Vignoli(Posted 2007) [#9]
Thanks Tom ;-)


Vertex(Posted 2007) [#10]
List input devices:
alcGetString(Null, ALC_CAPTURE_DEVICE_SPECIFIER)

Default input device:
alcGetString(Null, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER)

Open device:
alcCaptureOpenDevice(...)

Start recording:
alcCaptureStart(...)

Stop recording.
alcCaptureStop()

Get number of captured samples
alcGetIntegerv(Recorder, ALC_CAPTURE_SAMPLES, 4, Varptr(NumSamples))

Get samples:
alcCaptureSamples(...)

Very easy ^^
cu olli


Vignoli(Posted 2007) [#11]
Thanks a lot Vertex :-)


Vignoli(Posted 2007) [#12]
I've done that finally. It works a little but not perfectly.
Does someone see the problem, please ? (just test to listen what is the problem.)




Vertex(Posted 2007) [#13]
My test:


http://vertex.dreamfall.at/openal/openal103.zip
(Does only work on Windows and maybe Linux)


Vignoli(Posted 2007) [#14]
Thanks a lot Vertex ! :-)
You saved me ! ;-)


jhocking(Posted 2007) [#15]
I am trying to record sounds for a project I am working on right now and this information is very useful. However, I'm unclear on why Vignoli's code was behaving odd, and I don't really want to use Vertex's special framework because I would like to run this on either Windows or Mac.

Could someone explain why that first example was giving weird results? Vertex appears to be using alSourcePlay for playing the recorded sound, but I don't understand how that works.

ADDITION: gah now my ears are ringing and I have a headache because I screwed with the audio format and had the volume all the way up