Coder Social home page Coder Social logo

Comments (8)

ikbencasdoei avatar ikbencasdoei commented on June 6, 2024 1

I'm not an expert but I think this is certainly possible in Godot. But I really think it is better if you ask this in Godot Q&A, Godot Discord server, Godot subreddit, etc. I maybe can help you there and others can help as well.

from godot-voip.

ikbencasdoei avatar ikbencasdoei commented on June 6, 2024 1

Yes, you just have to add the capture effect to the same audio bus you play your music in and you will be able to capture it.

from godot-voip.

Gamemap avatar Gamemap commented on June 6, 2024

Ok, I think i will make an account at Godot Q&A.

from godot-voip.

Gamemap avatar Gamemap commented on June 6, 2024

I will look at you Input threshold.e2e78b2 Maybe something like that is what I need.

from godot-voip.

Gamemap avatar Gamemap commented on June 6, 2024

Somehow you send the audio data only when the input sensitivity is lower than the sound. Could you shortly explain how you did that and if it is possible to get a signal when the music is "louder"?

Edit: Have you used the new effect capture for that?
https://github.com/casbrugman/godot-voip/blob/e2e78b29cd1d944ca501f93eccd87c054ceeba37/addons/godot-voip/scripts/voip_instance.gd#L60

from godot-voip.

ikbencasdoei avatar ikbencasdoei commented on June 6, 2024

Yes I use the capture effect to get the microphone input for the plugin.
See:

    var stereo_data = _effect_capture.get_buffer(_effect_capture.get_frames_available())

    #Loop over the array to get the highest value.
    var max_value = 0.0
    for i in range(stereo_data.size()):
      var value = (stereo_data[i].x + stereo_data[i].y) / 2.0
      max_value = max(value, max_value)
  
    #If value is lower than the threshold stop
    if max_value < input_threshold:
      return

After that the logic you want to run when the threshold is reached.

from godot-voip.

Gamemap avatar Gamemap commented on June 6, 2024

Thank you!
I will try to implement this in the next few days.
Would the audio capture also work with music files or only with a mic?

from godot-voip.

Gamemap avatar Gamemap commented on June 6, 2024

I'm glad to tell you that the beat detection works :)
Thanks a lot for this code!

I have not done any fine tuning yet.

Here is an example (with audio):

Beat.mp4

from godot-voip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.