|
-
Mar 4th, 2024, 07:43 AM
#14
Addicted Member
Re: Capture audio and visualize it
Your only option then, is to use built-in windows PCM/WAV or MP3 audio streams.
All three will offer some form of potential visualization, if you hand-code some basic math to get the "levels" you are looking for. You will have to become familiar with the formats, or find someone who has already done the work for you.
It will not be fast, but it will function.
PCM/WAV is quite literal, once you know the format. The values are literally just a relation to a wave-form shape. At the lowest level, it is only a matter of reading the value, related to the "current location in the stream", and displaying the value on a chart. The harder part is figuring out the current time-position, since audio is all managed by third-party drivers that windows has used to replace the original drivers they once used. (All use Direct-Sound streams now)
The alternative to reading live-streams, is to read the whole file, in advance. Then place that data into an array, formatted as needed, for visualization. Then just monitor the "time position", of the stream and show that chunk of visualized data. (That removes any form of "active display")
MP3 will be a bit different, due to compression. You have to read the associated time-block-container, math the MIN/MAX/Compression, and then calculate the uncompressed "values", which will always be janky and slower. (In a roll-your-own math reader).
If you want live visualization, while capturing audio, within VB6, you are really pushing the bounds of reality. VB6 has no real way to directly interface audio-components, without some third-party device. The ones that windows uses, which VB6 gives you access to, have a real limited VB6 interaction. (Part of the reason is that VB6 is 32-bit and all current audio-drivers are all 64-bit, as is most new audio formats.)
Your last potential alternative is "DirectSound" or "DirectX". (DirectSound has since expired and been incorporated into DirectX, which is what windows uses for ALL audio that you physically hear from the OS, currently.) However, DirectSound still exists, due to legacy support, within DirectX.
https://en.wikipedia.org/wiki/DirectSound
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|