1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

use qstring for path when playing audio file

This commit is contained in:
Nils Fenner 2015-11-15 02:38:16 +01:00
parent b44ef6c596
commit 67fbee8868
No known key found for this signature in database
GPG Key ID: 9591A163FF9BE04C
4 changed files with 5 additions and 5 deletions

View File

@ -455,11 +455,11 @@ void Audio::playMono16Sound(const QByteArray& data)
/**
Play a 44100Hz mono 16bit PCM sound from a file
*/
void Audio::playMono16Sound(const char *path)
void Audio::playMono16Sound(const QString& path)
{
QFile sndFile(path);
sndFile.open(QIODevice::ReadOnly);
playMono16Sound(sndFile.readAll());
playMono16Sound(QByteArray(sndFile.readAll()));
}
/**

View File

@ -69,7 +69,7 @@ public:
void startLoop();
void stopLoop();
void playMono16Sound(const QByteArray& data);
void playMono16Sound(const char* path);
void playMono16Sound(const QString& path);
bool tryCaptureSamples(int16_t *buf, int samples);
void playAudioBuffer(quint32 alSource, const int16_t *data, int samples,

View File

@ -294,7 +294,7 @@ void ChatForm::onAvInvite(uint32_t FriendId, bool video)
Widget::getInstance()->newFriendMessageAlert(FriendId, false);
Audio& audio = Audio::getInstance();
audio.startLoop();
audio.playMono16Sound(":audio/ToxicIncomingCall.pcm");
audio.playMono16Sound(QStringLiteral(":/audio/ToxicIncomingCall.pcm"));
}
void ChatForm::onAvStart(uint32_t FriendId, bool video)

View File

@ -1243,7 +1243,7 @@ bool Widget::newMessageAlert(QWidget* currentWindow, bool isActive, bool sound,
}
if (Settings::getInstance().getNotifySound() && sound)
Audio::getInstance().playMono16Sound(":/audio/notification.pcm");
Audio::getInstance().playMono16Sound(QStringLiteral(":/audio/notification.pcm"));
}
return true;