October 17, 2019, 05:38:42 PM

Author Topic: How to record multiple channels from an audio acquisition card ?  (Read 386 times)

Offline Flanker

  • Jr. Member
  • **
  • Posts: 39
    • Youtube channel on Blitzmax programming prototypes
Hello, I was wondering if there is a module or API for BlitzMax wich would allow to access/record/process individual channels from an audio acquisition card like this one (USB card, 8 microphones inputs/channels) :



Years ago I used DirectPlay to do that with VisualBasic but it was too damn slow. I'd like to give it a try with BlitzMax.
Everyone knew it was impossible, until someone who didn't know made it.

Offline fielder

  • Jr. Member
  • **
  • Posts: 76
Re: How to record multiple channels from an audio acquisition card ?
« Reply #1 on: May 14, 2019, 09:56:10 AM »
on Bmax is hard to record from just 1 input (just 1 example for standard audio card microphone input) you have to look to Bmax like a C++ compiler.. if no one created a library for that you have to do by yourself ... if you have not find the microphone example on web.. i think you are not able to make changes to make it working on multi channel.

https://www.blitzforum.de/forum/viewtopic.php?t=33843

http://www.mojolabs.nz/posts.php?topic=90830

Offline Flanker

  • Jr. Member
  • **
  • Posts: 39
    • Youtube channel on Blitzmax programming prototypes
Re: How to record multiple channels from an audio acquisition card ?
« Reply #2 on: May 15, 2019, 05:14:46 AM »
Thanks for the links it will be useful, OpenAL might do the job.
Everyone knew it was impossible, until someone who didn't know made it.

Offline Flanker

  • Jr. Member
  • **
  • Posts: 39
    • Youtube channel on Blitzmax programming prototypes
Re: How to record multiple channels from an audio acquisition card ?
« Reply #3 on: May 22, 2019, 02:36:31 PM »
I started to play with OpenAL and it seems really nice for my use.

However I have a problem enumerating capture devices, the names are truncated like there is a string length limit (31 characters).

Here the code I use to enumerate devices (you can test on your system) :
Code: [Select]
Local pointer:Byte Ptr = alcGetString(Null,ALC_CAPTURE_DEVICE_SPECIFIER)
Local name:String
Local offset:Int

Repeat
name = String.FromCString(pointer+offset)
If name <> Null Then Print name
offset = offset + Len(name) + 1
Until name = Null

And here is the output on my system :
Code: [Select]
Microphone (Logitech USB Headse
Microphone (HD Webcam C270)
Headset (TaoTronics TT-BH22 Han

While it should be something like that :
Code: [Select]
Microphone (Logitech USB Headset)
Microphone (HD Webcam C270)
Headset (TaoTronics TT-BH22 Hands-Free)

I also tried the enumerate function written in the OpenAL bmx mod but it returns exactly the same output. As I intend to use OpenAL with an audio interface, with multiple capture devices and long names, I absolutely need the full names. If someone have a clue on this one it would be greatly appreciated.
Everyone knew it was impossible, until someone who didn't know made it.

Offline Henri

  • Full Member
  • ***
  • Posts: 209
Re: How to record multiple channels from an audio acquisition card ?
« Reply #4 on: May 22, 2019, 05:34:13 PM »
Hi,

what if you replace ALC_CAPTURE_DEVICE_SPECIFIER with a literal number 4115 ?

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Offline Flanker

  • Jr. Member
  • **
  • Posts: 39
    • Youtube channel on Blitzmax programming prototypes
Re: How to record multiple channels from an audio acquisition card ?
« Reply #5 on: May 22, 2019, 05:52:11 PM »
Yes I tried, it is the constant for ALC_ALL_DEVICES_SPECIFIER wich is a complete enumeration according to the documentation, but it seems to only enumerate playback devices (speakers) :

Code: [Select]
Generic Software on Headphones (TaoTronics TT-BH22 Stereo)
Generic Software on Headset (TaoTronics TT-BH22 Hands-Free)
Generic Software on Speakers (Logitech USB Headset H340)
Generic Software on Digital Audio (S/PDIF) (High Definition Audio Device)
Everyone knew it was impossible, until someone who didn't know made it.