• Welcome to Theos PowerBasic Museum 2017.

Audio capture with level display

Started by Chris Burgess, May 10, 2013, 02:34:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chris Burgess

We've been asked to add a means of recording audio from a USB headset.

What this is used for: basically:

1) User (student) clicks "Ready".   This starts the audio capture .

2) A word appears on the screen and the user (student) speaks the word, then clicks a "Done" button.

3) This stops the capture, and saves it to as network folder and sends a message to the teachers computer.

4) Teacher plays the file on his/her computer and clicks a grade.  If it's a fail the same word is sent next time the user clicks ready, if it's OK the next word is displayed instead.

5) After all (10 to 20) words are completed, the student is assigned a grade depending on what the teacher clicked and the number of retries they had to do.

One "non negotiable" was a requirement for a display showing the input level, so that users could visually confirm that the headset was connected, and so they could verify the headset was muted when not required (to comply with privacy rules).

The display is preferred to be active all the time, not just when recording. Creating the app was fairly straightforward, with some help from EZGUI. M programming background is microcontrollers and not Windows, so EZGUI takes care of all the forms, controls, and so on, and we only have to code the actual functionality of the app.  A version that uses a text box instead of audio was made, so all of the network, forms, and core code stuff is confirmed OK. 

The elusive part is the audio capture and level display.    The part I thought would be reasonably straightforward has turned into the most elusive...

Went looking around for a way to do it - we found one using mcisendstring commands that didn't have the level display and had issues with Win7, but was fine with XP.  MSDN states mcisendstring is "legacy" and is best not used on new projects. 

The other one was a DirectX addon, the BASS audio library from un4seen.com. This looked much more promising, but we could only find examples in other languages, except for one called Bassbox. This is way more complex than our needs and was only a player, but it might give up a clue or two how to read an audio level and display something on the screen based on it.

There is an audio capture utility mentioned in the forums here, with a reply stating it's commercial and closed source.   

However, we can't see it mentioned anywhere on zapsolution - either I'm looking in the wrong place or it's discontinued.

Even this is (visually) more than what we need - a simple progress control an inch long on the screen would do for the visual, and the filenames / paths will be hard coded and not visible to the user.

Question: Assuming the "audio capture" addon is still available, does it have to appear on screen as it is, or can it be used as an audio capture addon for our own app?   We need to keep the UI very simple, it's going to be used by young children and people with an intellectual disability, the less things for them to see and click on the better.

Failing that: Has anyone used the BASS library to do something like what we need, and if so, are you able / willing to share the source so we can add a cut down version of this to our app?

Thanks in advance to anyone that can help.

Chris B

Patrice Terrier

#1
Forget MCI it is just a toy...
Start learning the core WAVE API and SDK programming.
Bass.dll from Ian Luck (un4seen) is also a good option to start with.
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

A full fledged 64-bit flat API project has been posted here.

...

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com