530 Commits

Author SHA1 Message Date
Martin Pulec
c53d966e80 Audio compress: fixed encoder changing BPS with multichannel
Fixed a situation when audio compression changes BPS, eg. AAC:

    uv -s testcard --audio-codec AAC --audio-capture-format channels=2
2022-01-07 09:46:11 +01:00
Martin Pulec
1b3b27eb7c Updated copyright dates for modified files 2021-11-08 15:43:14 +01:00
Martin Pulec
6878d5de4b Audio playback SDI: s/capture/playback 2021-11-04 10:13:35 +01:00
Martin Pulec
2ec8eec912 Audio: display muted status even if not sending
Originally mute for both sender and receiver were dispatched by the
sender, which doesn't need to be present, however.
2021-10-27 13:31:17 +02:00
Martin Pulec
04734e0ebc Define ug_strerror for thread-safe strerror abstraction 2021-10-26 10:49:07 +02:00
Martin Pulec
2594da5a09 Wav writer: report write errors 2021-10-26 10:17:29 +02:00
Martin Pulec
068f126a81 ALSA play.: param help clarification 2021-10-14 10:52:47 +02:00
Martin Pulec
e27bc421bd Audio dump: added usage 2021-10-14 10:52:47 +02:00
Martin Piatka
bbaa729aa8 audio/export: Add missing const 2021-10-08 15:52:10 +02:00
Martin Piatka
782e0fdd95 audio/playback: dump module 2021-10-08 15:49:43 +02:00
Martin Pulec
c156ad9fa7 Audio export: fixed crash when no audio is expored
The export structure was not zero-initialized as expected when checked
for NULL.
2021-10-05 10:45:38 +02:00
Martin Pulec
09426b2a7c print rather err msg on wrong unit_evaluate(_dbl) val
Use an user-friendlier error message than assert.
2021-10-05 10:26:48 +02:00
Martin Pulec
80924bfd1b Audio: indicate muted sender in periodic stats 2021-10-04 14:07:20 +02:00
Martin Pulec
34f0445af8 Audio: print explicitly muted receiver 2021-10-04 14:06:07 +02:00
Martin Pulec
50d759fc9a Audio: interactive info mute improvements
- show actual playback volume as 0 (-inf) if muted receiver
- display explicitly receiver mute status
- "Received audio volume" -> "Playback volume" - this has more clear
  semantics and is consistent with message written when '*'/'/'/'m' is
  pressed.
2021-10-04 11:55:01 +02:00
Martin Pulec
5bf46b2de7 WAV writer: note about WAVE_FORMAT_EXTENSIBLE 2021-10-01 15:25:18 +02:00
Martin Pulec
43679c09fe WAV writer: write UINT32_MAX size first
Use UINT32_MAX for sizes first. This may help if WAV file is incorrectly
closed indicating that the size values aren't valid (at least FFmpeg
understands it so).
2021-10-01 10:53:44 +02:00
Martin Pulec
3adfc0144b WAV writer: better encapsluation 2021-10-01 10:49:13 +02:00
Martin Pulec
7c105394ae WASAPI play.: mark default device 2021-09-23 16:18:45 +02:00
Martin Pulec
3ac3be55b4 WASAPI cap.: mark default device 2021-09-23 16:17:25 +02:00
Martin Pulec
e59b6574ee Audio null playback/capture: error instead of assert
Do not assume that initialization of null device must succeed - eg. in
some errorneous setup there may be API mismatch leading to init failed.
2021-09-23 11:59:20 +02:00
Martin Pulec
83bb7f9f7d WAV reader: support for unseekable streams
Avoid needless seeks - data chunk must follow fmt chunk [1] thus the
file can be read without seeking (without the file size check).

[1] http://www.tactilemedia.com/info/MCI_Control_Info.html
2021-09-15 16:03:25 +02:00
Martin Pulec
672fc1b56d WAV writer: warning if writting data segment >4 GiB 2021-09-14 16:30:37 +02:00
Martin Pulec
79193bf827 WAV writer: use _fseeki64
Shouldn't make a difference but just to be consistent.
2021-09-14 16:17:15 +02:00
Martin Pulec
4039415374 wav_write_header: simplify + close file if error 2021-09-14 16:17:15 +02:00
Martin Pulec
572b4ce5cd Factored out WAV reader to separate file 2021-09-14 16:17:09 +02:00
Martin Pulec
15859d3ee0 Audio export: support for >4 GiB files
Similarly to WAV reader write UINT32_MAX as a placeholder if file is
longer than 4 GiB
2021-09-14 14:38:21 +02:00
Martin Pulec
c1fea40df7 WAV reader: read >4 GiB files
Has data chunk size set to UINT32_MAX and size is deduced from file
length. This is consistent to what FFmpeg (MediaInfo, MPV and perhaps
others) does.
2021-09-14 14:37:38 +02:00
Martin Piatka
1b00554f5e alsa: playback: Fix silence when bps == 1
Cannot reuse the same buffer for silence, because in audio_play_alsa_write_frame()
it gets converted from signed to unsigned. If the frame is reused it
causes alternation between 0 and -127, causing a loud square wave to be
played.
2021-09-09 13:47:09 +02:00
Martin Pulec
c35083fa91 Suppress clang warnings 2021-09-08 08:25:10 +02:00
Martin Pulec
ff7502b523 Fixed usleep calls 2021-09-06 13:32:55 +02:00
Martin Pulec
9c03c052eb audio_frame2: make copy ctor + assign deleted
Make copy constructor and assignment operator explicitly deleted - until
now it has been deleted implicitly so this is just to ensure that this
is actually a desired behavior. The operation in the internal pipeline
should be copy-free (af2 is used only there). If really needed, some
explicit function for copy could be written.
2021-08-19 09:59:46 +02:00
Martin Pulec
982e0efd0c Removed DEFAULTED compat
Was needed for MSVS 2013 that wouldn't perhaps compile UG anyway today.
2021-08-19 09:57:47 +02:00
Martin Pulec
a21b8e4d6a WAV reader: skip unknown tags 2021-08-18 15:02:35 +02:00
Martin Pulec
8f557a97d6 Replaced audio/audio.h with audio/types.h includes
audio/audio.h should not be used as a catch-all header for audio.
2021-08-11 15:58:58 +02:00
Martin Pulec
2fefba5259 Audio codec: prevent crashes when decreased number of channels
Number of codec states may exceed the actual number of frame channels
(states are not deleted).
2021-08-11 13:32:41 +02:00
Martin Pulec
1e9853e9e5 Audio compress: return object instead of pointer 2021-08-11 13:28:25 +02:00
Martin Pulec
1ef9c8a8c0 CoreAudio cap.: removed deprecated calls 2021-08-11 13:14:46 +02:00
Martin Pulec
e6515ed4ad audio conversions: fixed const casts 2021-08-10 08:44:05 +02:00
Martin Pulec
aea78bc1b9 format_from_in_bps, format_to_out_bps - improved
Use the templated loaders for format_from_in_bps and format_to_out_bps.
2021-08-06 14:55:41 +02:00
Martin Pulec
66fda1ae23 Audio sender: fixed always resampling
The signal was always due to incorrect condition. This would not be a
problem if sample rate matches codec supported rate (then it will be a
noop) but as a side effect, the signal is always converted to 16-bit
range (resampler uses that).
2021-08-06 14:01:00 +02:00
Martin Pulec
9987999b19 Export audio: store 8-bit samples as uint8 2021-08-06 11:49:22 +02:00
Martin Pulec
c2fed1f0c7 Audio testcard: option for frequency 2021-08-06 11:40:43 +02:00
Martin Pulec
5901bd6b3e wav_reader: add read function and use it 2021-08-06 11:32:12 +02:00
Martin Pulec
bdfb8dbeb2 Lavcd audio: convert from/to uint8 2021-08-06 11:31:27 +02:00
Martin Pulec
4c85bcf56c Lavd audio: use float2int in place 2021-08-06 11:16:36 +02:00
Martin Pulec
53770ce327 Audio utils: improved prototypes + docu 2021-08-06 11:12:17 +02:00
Martin Pulec
4f9a69d4f0 calculate_rms: improved and polished
Rewrite using the new templates to avoid custom code and increase
performance.
2021-08-06 11:06:48 +02:00
Martin Pulec
4dce7d3a87 get_avg_volume: improved performance 2021-08-05 08:53:11 +02:00
Martin Pulec
1fba84828a WAV reader: better handling unsupported fmt len 2021-08-02 15:04:27 +02:00