mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-10 14:53:00 +02:00
more windows build fixes
This commit is contained in:
parent
9afe6eaa25
commit
f9f29c68b2
2 changed files with 11 additions and 7 deletions
|
@ -64,7 +64,7 @@ DomainServer::DomainServer(int argc, char* argv[]) :
|
|||
|
||||
QString documentRootString = QString("%1/resources/web").arg(QCoreApplication::applicationDirPath());
|
||||
|
||||
char documentRoot[documentRootString.size() + 1];
|
||||
char* documentRoot = new char[documentRootString.size() + 1];
|
||||
strcpy(documentRoot, documentRootString.toLocal8Bit().constData());
|
||||
|
||||
// list of options. Last element must be NULL.
|
||||
|
@ -105,6 +105,8 @@ DomainServer::DomainServer(int argc, char* argv[]) :
|
|||
QTimer::singleShot(RESTART_HOLD_TIME_MSECS, this, SLOT(addStaticAssignmentsBackToQueueAfterRestart()));
|
||||
|
||||
connect(this, SIGNAL(aboutToQuit()), SLOT(cleanup()));
|
||||
|
||||
delete[] documentRoot;
|
||||
}
|
||||
|
||||
void DomainServer::readAvailableDatagrams() {
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
// Copyright (c) 2014 HighFidelity, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <QtNetwork/QNetworkAccessManager>
|
||||
#include <QtNetwork/QNetworkRequest>
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
|
@ -17,26 +19,26 @@ Sound::Sound(const QUrl& sampleURL, QObject* parent) :
|
|||
{
|
||||
// assume we have a QApplication or QCoreApplication instance and use the
|
||||
// QNetworkAccess manager to grab the raw audio file at the given URL
|
||||
|
||||
|
||||
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
|
||||
connect(manager, SIGNAL(finished(QNetworkReply*)),
|
||||
this, SLOT(replyFinished(QNetworkReply*)));
|
||||
|
||||
|
||||
manager->get(QNetworkRequest(sampleURL));
|
||||
}
|
||||
|
||||
void Sound::replyFinished(QNetworkReply* reply) {
|
||||
// replace our byte array with the downloaded data
|
||||
QByteArray rawAudioByteArray = reply->readAll();
|
||||
|
||||
|
||||
// assume that this was a RAW file and is now an array of samples that are
|
||||
// signed, 16-bit, 48Khz, mono
|
||||
|
||||
|
||||
// we want to convert it to the format that the audio-mixer wants
|
||||
// which is signed, 16-bit, 24Khz, mono
|
||||
|
||||
|
||||
_byteArray.resize(rawAudioByteArray.size() / 2);
|
||||
|
||||
|
||||
int numSourceSamples = rawAudioByteArray.size() / sizeof(int16_t);
|
||||
int16_t* sourceSamples = (int16_t*) rawAudioByteArray.data();
|
||||
int16_t* destinationSamples = (int16_t*) _byteArray.data();
|
||||
|
|
Loading…
Reference in a new issue