Classified ads
audioencoder.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_ENCODER_H
22 #define AUDIO_ENCODER_H
23 
24 #include <QObject>
25 #include <opus/opus.h> // for data types
26 
34 class AudioEncoder : public QObject {
35  Q_OBJECT
36 
37 public:
41  AudioEncoder(quint32 aSampleRate = 8000,
42  quint32 aNumChannels = 1 ) ;
43  ~AudioEncoder() ;
44 
45 signals:
57 void frameEncoded(quint32 aCallId,
58  quint32 aSeqNo,
59  const QByteArray& aEncodedData) ;
60 public slots:
70 void frameReady(quint32 aCallId,
71  quint32 aSeqNo,
72  const QByteArray& aAudioData) ;
73 private: // members
74  OpusEncoder *iEncoder ;
75  unsigned char *iEncodedData ;
76  const quint32 iNumChannels ;
77 } ;
78 #endif
AudioEncoder(quint32 aSampleRate=8000, quint32 aNumChannels=1)
class for compressing audio to be sent over network
Definition: audioencoder.h:34
void frameEncoded(quint32 aCallId, quint32 aSeqNo, const QByteArray &aEncodedData)
OpusEncoder * iEncoder
Definition: audioencoder.h:74
unsigned char * iEncodedData
Definition: audioencoder.h:75
const quint32 iNumChannels
Definition: audioencoder.h:76
void frameReady(quint32 aCallId, quint32 aSeqNo, const QByteArray &aAudioData)