Does anyone have an `AudioStreamPlayer3D` example?

nolannolan Posts: 19Member

I can't find one anywhere, not even in the demo projects. Still trying to figure out why my basic example from the previous post isn't working. I've looked for an example in the Godot demo projects, searched Google, tried to do a GitHub code search though I can't figure that out, asked on IRC and GitHub . I'm actually starting to wonder if this secretly doesn't work, or if my custom engine build doesn't include audio support for lack of a library. :) Seeing lots of 2-D examples, but can't find a simple AudioStreamPlayer3D/Listener example.

Thanks.

Answers

  • urieluriel Posts: 59Member

    Again nolan, the audiostreamplayer works the same way that the other types of players, exept it needs a camera to get listen ;)

  • totorototoro Posts: 15Member

    This camera requirement solved my issue!

    But there is a tutorial here:
    https://docs.godotengine.org/en/3.2/tutorials/3d/fps_tutorial/part_three.html
    Also see page 6

  • eyeEmotioneyeEmotion Posts: 83Member
    edited April 23

    I'm still at loss. I'm not doing it through code but through the Inspector and I don't find any tutorials to get it working
    I've added an AudioStreamPlayer3D, I've put it on the location where I want it and play it together with my animation. At first I didn't get a sound at all. Not even when I checked Playing in the Inspector.
    Then I changed the Attenuation Model from the default "Inverse" to Disabled and all of a sudden I got sound. So the sound and the player are working. But the trouble is that the sound doesn't seem to be location based and I hear it the same way as I would with background-music, coming from everywhere... while I'm passing it from the right, so I should be hearing it from the left.
    If I enable Emission Angle, I can see the cone appearing. Even put that in the direction I want the sound to go to, but nothing...

    So how do you set this up through the Inspector and in the Editor.

    Edit: so ok, I just had to set the Unit Size, it was on 0. They really should say that in the Docs "tutorial" on this subject, since apparently it is the main thing you need to set and not mentioned in the Docs "tutorial".

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file