diff --git a/sdrbase/audio/audioopus.cpp b/sdrbase/audio/audioopus.cpp index 4f9eaa082..332809b33 100644 --- a/sdrbase/audio/audioopus.cpp +++ b/sdrbase/audio/audioopus.cpp @@ -86,6 +86,12 @@ int AudioOpus::encode(int frameSize, int16_t *in, uint8_t *out) { QMutexLocker mutexLocker(&m_mutex); + if (!m_encoderOK) + { + qWarning("AudioOpus::encode: encoder not initialized"); + return 0; + } + int nbBytes = opus_encode(m_encoderState, in, frameSize, out, m_maxPacketSize); if (nbBytes < 0) diff --git a/sdrbase/sdrbase.pro b/sdrbase/sdrbase.pro index 0a295936d..7d49d1af2 100644 --- a/sdrbase/sdrbase.pro +++ b/sdrbase/sdrbase.pro @@ -139,7 +139,7 @@ HEADERS += audio/audiodevicemanager.h\ audio/audiocompressor.h\ audio/audiofifo.h\ audio/audiofilter.h\ - audio/audiog722.h\ + audio/audiog722.h\ audio/audioopus.h\ audio/audiooutput.h\ audio/audioinput.h\ @@ -235,7 +235,7 @@ HEADERS += audio/audiodevicemanager.h\ mainparser.h MSVC { - LIBS += -LC:\softs\libopus_v1.3_msvc15\lib\x64 -lopus + LIBS += -LC:\softs\libopus_v1.3_msvc15\bin\x64 -LC:\softs\libopus_v1.3_msvc15\lib\x64 -lopus } MINGW32 || MINGW64 || MSVC { LIBS += -L../serialdv/$${build_subdir} -lserialdv diff --git a/sdrgui/audio.md b/sdrgui/audio.md index 3c158acde..c8eee3e7e 100644 --- a/sdrgui/audio.md +++ b/sdrgui/audio.md @@ -67,7 +67,7 @@ This is the codec applied before sending the stream via UDP. The following are a - `PCMA`: A-law 8 bit PCM (requires 8000 Hz sample rate mono) - `PCMU`: Mu-law 8 bit PCM (requires 8000 Hz sample rate mono) - `G722`: G722 64 kbit/s (requires 16000 Hz sample rate mono) - - `OPUS` : Opus constant 64 kbit/s (requires 48, 24, 16 or 12 kHz sample rates) + - `opus` : Opus constant 64 kbit/s (requires 48, 24, 16 or 12 kHz sample rates. 48 kHz makes more sense when using Opus)

1.10 SDP string

@@ -90,18 +90,18 @@ Use this button to activate or de-activate the copy of the audio stream to UDP s Check this box to activate the RTP protocol over UDP. RTP parameters are as follows: - Payload type: - - codec `L16`, `L8`: 96 - - codec `OPUS`: 101 + - codec `L16`, `L8`, `opus`: 96 - codec `PCMA`: 8 - codec `PCMU`: 0 - codec `G722`: 9 - Sample rate: the resulting stream sample rate after decimation and possible compression: - codec `PCMA`, `PCMU`: must be 8000 S/s - codec `G722`: must be 8000 S/s (16000 S/s input before compression) + - codec `opus`: timestamp increment is that of 20ms @ 48kHz i.e. 960 but actual payload and sample rate is 160 bytes at 8 kHz - Sample format: - codec `L16`: 16 bit integer signed (S16LE) - codec `L8`, `PCMA`, `PCMU`: 8 bit integer signed (S8) - - codec `G722`, `OPUS`: 8 bit unsigned integer. Note that this is the stream compressed to 64 kbits/s. + - codec `G722`, `opus`: 8 bit unsigned integer. Note that this is the stream compressed to 64 kbits/s. - Channels: 1 for mono (Left, Right and Mixed copy channels mode); 2 for stereo (Stereo copy channels mode) - Address and port: destination address and port (local on the client machine) diff --git a/windowsms.install.bat b/windowsms.install.bat index 7ab7407a5..5a253e301 100644 --- a/windowsms.install.bat +++ b/windowsms.install.bat @@ -7,6 +7,7 @@ SET pothosdir="C:\Program Files\PothosSDR" SET pthreadsdir="C:\softs\pthreads-w32" SET ffmpegdir="C:\softs\ffmpeg-20181127-1035206-win64-shared\bin" SET qt5dir="C:\Qt\5.11.1\msvc2017_64\bin" +SET libopusdir="C:\softs\libopus_v1.3_msvc15\bin\x64" copy app\%1\sdrangel.exe %2 copy sdrbase\%1\sdrbase.dll %2 @@ -43,6 +44,7 @@ REM copy %opencvdir%\libopencv_highgui2413.dll %2 REM copy %opencvdir%\libopencv_core2413.dll %2 copy %ffmpegdir%\*.dll %2 copy %qt5dir%\Qt5Qml.dll %2 +copy %libopusdir%\opus.dll %2 mkdir %2\plugins mkdir %2\plugins\channelrx