Quantcast
Viewing all articles
Browse latest Browse all 1449

VB6 RC5-CoreAudio-Demo

Here a small CoreAudio-Example, based on the appropriate abstraction-Classes of the RichClient.
(as mentioned and requested in this thread): http://www.vbforums.com/showthread.p...ther-like-Game

CoreAudio was introduced as the new (LowLevel) SoundAPI for Win-Versions from Vista onwards.

It allows such things as "InApp-Session-VolumeControl, Soundbuffer-reading and -writing, Enumeration of
Sound-Devices, Fine-Control over each of the channels of e.g. a "5+1" SoundCard etc...

The Read-direction of CoreAudio-SoundBuffers I've already covered in this older example here:
http://www.vbforums.com/showthread.p...and-onwards%29
(visualizing the Buffer-Input, which comes in over: ...GetDefaultAudioEndpoint(eCapture, eCommunications) -> usually the microphone).

This example here is focusing on demonstrating the handling of "InApp-SoundVolume/Muting" -
and the SoundRendering of 4 smaller SoundBuffers (which reside as *.mp3 in the Apps \Res\-SubFolder).
Here the Zip: CoreAudioDemo.zip

With relatively low efforts, one could expand on this Demo, to e.g. implement a nice
"Piano-Roll-like Sequencer" - or something alike (as seen in some Phone- or -Tablet-Apps, that cover
simple "SoundLoop-Pattern-Mixers" which support live-changes of "correctly fitted" Sample-Loops).

Here's a ScreenShot, what the Demo currently looks like:
Image may be NSFW.
Clik here to view.


The 4 SoundSample-Player-Widgets to the right of the above Form can be:
- in case of the Top-Widget, labelled 'SampleLoop' - switched On and Off permanently
- and the lower three Sound-Widgets are in "Tap-Mode" (acting more like a little Drum-Kit)

So you can Switch-On the TopMost Sound - it will be in repeat-mode by default -
and then you can add sound by "tapping" the other three (if you keep the Mouse down,
the 3 Tap-Widgets will repeat themselves in a timely fashion).

So, whilst the right part of the above ScreenShot demonstrates the CoreAudio-SoundBuffer-Handling,
the left part of the Screen (the rotating Knob-Widget) demonstrates the interaction with:
- cSimpleAudioVolume (responsible for interaction with the InApp-SoundLevel and InApp-Muting)
- cAudioMeterInformation (responsible for the Peak-Meter-Visualization at the bottom of the Knob).

This InApp-AudioVolume-Handling works in a "two-way-fashion", since it is also present in
the new WinSystem-Mixer-Dialogues:
Image may be NSFW.
Clik here to view.


In the above ScreenShot, the focused Entry labeled "CoreAudioDemo" allows to
control your InApp-SoundVolume/Muting as well - and should be properly reflected
in the appropriate Control of your App, so that both GUI-interactions remain "synced"
(the Knob reflecting the Settings of the System-Dialogue, and vice versa).

Image may be NSFW.
Clik here to view.


The cSimpleAudioVolume-Class of the RC5 offers the needed Events for that kind of
two-way interaction.

But take a look at the code yourself, play around a bit - and just ask when something is not clear.

Have fun!

Olaf
Attached Files

Viewing all articles
Browse latest Browse all 1449

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>