Added native audio sounds

This commit is contained in:
WolverinDEV
2020-03-18 23:32:57 +01:00
parent 6f9544e7f6
commit d918a822e2
26 changed files with 725 additions and 56 deletions
@@ -1,27 +0,0 @@
//
// Created by wolverindev on 19.06.19.
//
#include "AudioEventLoop.h"
using namespace tc;
event::EventExecutor* audio::decode_event_loop = nullptr;
event::EventExecutor* audio::encode_event_loop = nullptr;
void audio::init_event_loops() {
audio::shutdown_event_loops(); /* just to ensure */
audio::decode_event_loop = new event::EventExecutor("a en/decode ");
audio::encode_event_loop = audio::decode_event_loop;
audio::decode_event_loop->initialize(2);
}
void audio::shutdown_event_loops() {
if(audio::decode_event_loop) {
delete audio::decode_event_loop;
audio::decode_event_loop = nullptr;
}
audio::encode_event_loop = nullptr;
}
@@ -1,13 +0,0 @@
#pragma once
#include "../../EventLoop.h"
namespace tc {
namespace audio {
extern event::EventExecutor* encode_event_loop;
extern event::EventExecutor* decode_event_loop;
extern void init_event_loops();
extern void shutdown_event_loops();
}
}
@@ -2,7 +2,7 @@
#include "VoiceConnection.h"
#include "../ServerConnection.h"
#include "../../logger.h"
#include "AudioEventLoop.h"
#include "../../audio/AudioEventLoop.h"
#include "../../audio/AudioMerger.h"
using namespace std;
@@ -4,7 +4,7 @@
#include "../../audio/codec/OpusConverter.h"
#include "../../audio/AudioMerger.h"
#include "../../audio/js/AudioOutputStream.h"
#include "AudioEventLoop.h"
#include "../../audio/AudioEventLoop.h"
#include "../../logger.h"
using namespace std;
@@ -56,7 +56,6 @@ namespace tc {
template<typename _Tp, typename _Up>
friend inline std::shared_ptr<_Tp> std::static_pointer_cast(const std::shared_ptr<_Up>& __r) noexcept;
#endif
//_NODISCARD shared_ptr<_Ty1> static_pointer_cast(shared_ptr<_Ty2>&& _Other) noexcept
public:
struct state {
enum value {
@@ -163,7 +163,7 @@ void TransferObjectWrap::do_wrap(v8::Local<v8::Object> object) {
);
Nan::Set(object,
Nan::New<v8::String>("name").ToLocalChecked(),
Nan::New<v8::String>(this->target()->name().c_str()).ToLocalChecked()
Nan::New<v8::String>(this->target()->name().c_str()).ToLocalChecked()
);
if(source) {