B4J Question Monitor PC audio input level

bdunkleysmith

Active Member
Licensed User
Longtime User
I'm working on an application which needs to monitor the PC audio input level and trigger alternative actions if the level falls below or above adjustable threshold values.

I thought Steve05's JAudioRecord library may provide the basis of that and so investigated the example contained in that thread.

However while the record to file function works OK, the displayed volume/amplitude does not appear to reflect the input level and this is the actual function I need.

Can anyone provide advice as to why the displayed amplitude doesn't reflect the input level or an alternative approach to obtain the audio input level to be used in my application?
 

bdunkleysmith

Active Member
Licensed User
Longtime User
Thanks for your guidance Steve.

I've played with the sampling range and scaling, including making it logarithmic and have achieved acceptable functionality, but I'll probably do some more refinement such as applying some averaging to minimise false triggers in my application.

Thanks again . .
 
Upvote 0

Blueforcer

Well-Known Member
Licensed User
Longtime User
Can your share your code so far? Maybe we can work together.
I also need a function to Check the levels for different Frequencies from the system audio
 
Upvote 0

bdunkleysmith

Active Member
Licensed User
Longtime User
I'm happy to share my code and the project is attached.

I don't plan to develop this project any further because even in its current unsophisticated form it achieves my objective.

To explain a little more, I am involved in livestreaming game video from our local basketball competition to YouTube, but music is played during breaks in play and with YouTube screening all content, they may block the video if copyrighted music content is detected. Therefore I sample the music output from the Court Commentator's PA mixer so that when music is played the B4J app sends an appropriate code to my streaming app (vMix) via UDP to mute the audio. When the music is not playing, the audio is unmuted so viewers of the streaming video can can hear the venue ambient sound via the video camera audio channel. Here's a link to an example on YouTube:
Incidentally the superimposed scoreboard on that video is also a B4J app which consumes data input via USB from an Arduino based scoreboard interface box I built and coded using B4R. I can update some elements of the B4J display remotely via WiFi using an Android app developed using B4A.

It sounds like your project is much more complex given you need to be frequency selective in determining levels. I'd not know where to start with concept for that projects . . .
 

Attachments

  • vMixAudioController.zip
    116.4 KB · Views: 274
Last edited:
Upvote 0
Top