-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Audio improvements, fixed angular forces (no more glitching out!)
- Loading branch information
Showing
14 changed files
with
68 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## TODO: documentation | ||
class_name CarBrakeSquealSound extends AudioStreamPlayer3D | ||
|
||
@onready var car: Car = get_node("..") | ||
|
||
var smoothed_brake_amount: SmoothedFloat = SmoothedFloat.new(0.0, 8.0, 4.0) | ||
|
||
func _physics_process(delta: float) -> void: | ||
var target_value: float = (car.input_forward if car.is_reversing() else car.input_backward) * car.ground_coefficient | ||
# TODO: account velocity too | ||
smoothed_brake_amount.advance_to(target_value, delta) | ||
volume_db = linear_to_db(lerp(0.0, 1.0, smoothed_brake_amount.get_current_value())) | ||
|
||
if is_inf(volume_db): | ||
volume_db = -80.0 | ||
if volume_db >= -60.0 and not playing: | ||
play(randf_range(0.0, stream.get_length())) | ||
elif volume_db < -60.0 and playing: | ||
stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
uid://t5im4xcigfjb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
## TODO: documentation | ||
class_name CarTireScreechSound extends AudioStreamPlayer3D | ||
@export var pitch_range: Vector2 = Vector2(0.5, 1.0) | ||
|
||
@onready var car: Car = get_node("..") | ||
|
||
func _physics_process(_delta: float) -> void: | ||
|
||
pitch_scale = lerp(0.5, 1.25, car.burnout_amount) | ||
|
||
pitch_scale = lerp(pitch_range.x, pitch_range.y, car.burnout_amount) | ||
volume_db = linear_to_db(car.burnout_amount) | ||
|
||
if is_inf(volume_db): | ||
volume_db = -80.0 | ||
if volume_db > -60.0 and not playing: | ||
if volume_db >= -60.0 and not playing: | ||
play(randf_range(0.0, stream.get_length())) | ||
elif volume_db <= -60.0 and playing: | ||
elif volume_db < -60.0 and playing: | ||
stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
tire_screech.ogg: screeching tyres / tires by fractanimal -- https://freesound.org/s/614627/ -- License: Creative Commons 0 | ||
tire_screech.ogg: Chrysler LHS tire squeal 04 (04-25-2009).wav by audible-edge -- https://freesound.org/s/71739/ -- License: Creative Commons 0 | ||
collision_1.ogg: Collision 1 by JustInvoke -- https://freesound.org/s/446126/ -- License: Attribution 4.0 | ||
collision_3.ogg: Collision 2 by JustInvoke -- https://freesound.org/s/446125/ -- License: Attribution 4.0 | ||
collision_3.ogg: Collision 3 by JustInvoke -- https://freesound.org/s/446132/ -- License: Attribution 4.0 | ||
scratch.ogg: metal plate scratch by Ridderick -- https://freesound.org/s/707639/ -- License: Creative Commons 0 | ||
landing.ogg: Car Land/Hit by JustInvoke -- https://freesound.org/s/446135/ -- License: Attribution 4.0 | ||
brake_squeal.ogg: Car Brakes sqeak screech squeal stop.wav by WavJunction.com -- https://freesound.org/s/456764/ -- License: Creative Commons 0 | ||
|
||
Engine sounds created with https://github.com/DasEtwas/enginesound from on example .esc files |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[remap] | ||
|
||
importer="oggvorbisstr" | ||
type="AudioStreamOggVorbis" | ||
uid="uid://cun1ch44lb6ma" | ||
path="res://.godot/imported/brake_squeal.ogg-6c76d6ac2bcb276b35854e6d1b0198a0.oggvorbisstr" | ||
|
||
[deps] | ||
|
||
source_file="res://addons/aacc/sounds/brake_squeal.ogg" | ||
dest_files=["res://.godot/imported/brake_squeal.ogg-6c76d6ac2bcb276b35854e6d1b0198a0.oggvorbisstr"] | ||
|
||
[params] | ||
|
||
loop=true | ||
loop_offset=0.0 | ||
bpm=0.0 | ||
beat_count=0 | ||
bar_beats=4 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters