started work on sorce and listener
This commit is contained in:
30
src/steam_audio_source.cpp
Normal file
30
src/steam_audio_source.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Created by bryce on 5/9/2025.
|
||||
//
|
||||
|
||||
#include "steam_audio_source.h"
|
||||
|
||||
#include "steam_audio.h"
|
||||
|
||||
using namespace godot;
|
||||
|
||||
SteamAudioSource::SteamAudioSource() {
|
||||
|
||||
}
|
||||
SteamAudioSource::~SteamAudioSource() {
|
||||
if (steam_audio_source) {
|
||||
iplSourceRelease(&steam_audio_source);
|
||||
steam_audio_source = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void SteamAudioSource::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("play"), &SteamAudioSource::play);
|
||||
ClassDB::bind_method(D_METHOD("stop"), &SteamAudioSource::stop);
|
||||
ClassDB::bind_method(D_METHOD("set_stream","stream"), &SteamAudioSource::set_stream);
|
||||
}
|
||||
|
||||
void SteamAudioSource::play() {
|
||||
audio_player = memnew(AudioStreamPlayer3D);
|
||||
add_child(audio_player);
|
||||
}
|
||||
Reference in New Issue
Block a user