Classified ads
audiodecoder.h
Go to the documentation of this file.
1 /* -*-C++-*- -*-coding: utf-8-unix;-*-
2  Classified Ads is Copyright (c) Antti Järvinen 2015.
3 
4  This file is part of Classified Ads.
5 
6  Classified Ads is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  Classified Ads is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with Classified Ads; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #ifndef AUDIO_DECODER_H
22 #define AUDIO_DECODER_H
23 
24 #include <QObject>
25 #include <opus/opus.h> // for data types
26 #include "../util/hash.h"
27 
33 class AudioDecoder : public QObject {
34  Q_OBJECT
35 
36 public:
40  AudioDecoder(quint32 aSampleRate = 8000,
41  quint32 aNumChannels = 1 ) ;
42  ~AudioDecoder() ;
43 
44 signals:
54 void frameDecoded(quint32 aCallId,
55  quint32 aSeqNo,
56  const QByteArray& aEncodedData,
57  Hash aOriginatingNode ) ;
58 public slots:
62 void frameReceived(quint32 aCallId,
63  quint32 aSeqNo,
64  const QByteArray& aAudioData,
65  Hash aOriginatingNode ) ;
66 private: // members
67  OpusDecoder* iDecoder ;
68  QByteArray iDecodedData ;
69  const quint32 iNumChannels ;
70  const quint32 iSampleRate ;
71 } ;
72 #endif
class for de-compressing audio received from network
Definition: audiodecoder.h:33
void frameDecoded(quint32 aCallId, quint32 aSeqNo, const QByteArray &aEncodedData, Hash aOriginatingNode)
AudioDecoder(quint32 aSampleRate=8000, quint32 aNumChannels=1)
void frameReceived(quint32 aCallId, quint32 aSeqNo, const QByteArray &aAudioData, Hash aOriginatingNode)
const quint32 iNumChannels
Definition: audiodecoder.h:69
Hash is class that carries 160-bit digest.
Definition: hash.h:38
OpusDecoder * iDecoder
Definition: audiodecoder.h:67
const quint32 iSampleRate
Definition: audiodecoder.h:70
QByteArray iDecodedData
Definition: audiodecoder.h:68