Smart Audio Stream

An asset by nonunknown
The page banner background of a mountain and forest
Smart Audio Stream hero image

Quick Information

0 ratings
Smart Audio Stream icon image
nonunknown
Smart Audio Stream

Simple, think a jumping audio with a duration of 1 sec but your player takes only .5s to do jumps, using the normal AudioStream it will cut the currently playing audio and start it again, with this plugin it knows if a sound is already playing and instead of cut and play again it will set another stream to play so you will hear the sounds without cutting them.

Supported Engine Version
3.2
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
3 years ago
Git URL
Issue URL

Smart Audio Stream

  • Godot 3.2

Description

Currently its only implemented for AudioStreamPlayer3D but you can easily convert it just by changing:

extends AudioStreamPlayer3D # change 3D to 2D

What this plugin does?

Simple, think a jumping audio with a duration of 1 sec but your player takes only .5s to do jumps, using the normal AudioStream it will cut the currently playing audio and start it again, with this plugin it knows if a sound is already playing and instead of cut and play again it will set another stream to play so you will hear the sounds without cutting them.

How to use?

  • Activate plugin
  • Create a Node searching by SmartAudioStream3D
  • set the initial amount of streams
  • set the array of audio samples (.wav or .ogg)
  • them with a reference to this node call $SmartStream.play_audio(sample_index)
  • Tips:
# you can use a enum for easily refer the audio you want
# suppose you have This tree
# - KinematicBody (this script is here)
#  L SmartAudioStream3D
#  L OtherNodes
# suppose too you have two audios on SmartAudio samples exported var [jump,talk]
# use this:

enum AUDIO {JUMP, TALK}

func _ready():
    $SmartAudioStream3D.play_audio(AUDIO.TALK)

How does it works behind the scenes?

The smartAudio stream class has:

  • initial_stream - (how many AudioStreamPlayer3D will be generated at _ready)
  • samples - Audio Files Array
  • play_audio(sample_idx) - play the audio according to samples array
  • the following are private:
    • _create_stream (generate streams to avoid audio cutting)
    • _play_last_stream (when all audios from array are playing it will generate a new stream and play the audio on it)

Simple, think a jumping audio with a duration of 1 sec but your player takes only .5s to do jumps, using the normal AudioStream it will cut the currently playing audio and start it again, with this plugin it knows if a sound is already playing and instead of cut and play again it will set another stream to play so you will hear the sounds without cutting them.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Smart Audio Stream icon image
nonunknown
Smart Audio Stream

Simple, think a jumping audio with a duration of 1 sec but your player takes only .5s to do jumps, using the normal AudioStream it will cut the currently playing audio and start it again, with this plugin it knows if a sound is already playing and instead of cut and play again it will set another stream to play so you will hear the sounds without cutting them.

Supported Engine Version
3.2
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
3 years ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers