diff options
author | j.novak@netsystem.cz <j.novak@netsystem.cz> | 2021-03-31 14:52:06 +0000 |
---|---|---|
committer | Wireshark GitLab Utility <6629907-ws-gitlab-utility@users.noreply.gitlab.com> | 2021-03-31 14:52:06 +0000 |
commit | 7e39f4eb864174545b646f4883d17eb39173d17b (patch) | |
tree | ec5304f68edc75b500dae7819621ca1d64d4d5e9 /ui/qt/rtp_audio_stream.cpp | |
parent | 68ba60774f8e055da60352cb710e02817546ca52 (diff) |
RTP Player: Added ability to save streams as .au and .wav
Features:
- saves multiple streams (all selected and unmuted)
- saves streams same way they are played (jitter buffer, sampling, ...)
- only streams with audio (play rate >0) are exported
- streams with play rate == 0 are silently ignored even selected for
export
- all exported streams must use same play rate (user can change it
before save)
Diffstat (limited to 'ui/qt/rtp_audio_stream.cpp')
-rw-r--r-- | ui/qt/rtp_audio_stream.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/qt/rtp_audio_stream.cpp b/ui/qt/rtp_audio_stream.cpp index 80d637c436..0d9c0529c6 100644 --- a/ui/qt/rtp_audio_stream.cpp +++ b/ui/qt/rtp_audio_stream.cpp @@ -819,4 +819,14 @@ SAMPLE *RtpAudioStream::resizeBufferIfNeeded(SAMPLE *buff, gint32 *buff_bytes, q return buff; } +void RtpAudioStream::sampleFileSeek(qint64 samples) +{ + sample_file_->seek(sizeof(SAMPLE) * samples); +} + +qint64 RtpAudioStream::sampleFileRead(SAMPLE *sample) +{ + return sample_file_->read((char *)sample, sizeof(SAMPLE)); +} + #endif // QT_MULTIMEDIA_LIB |