Commit Graph

21 Commits

Author SHA1 Message Date
Bill Somerville
2a3e4c1e50
Merge branch 'feat-refactor' of bitbucket.org:g4wjs/wsjtx-refactor into feat-refactor 2019-07-03 00:59:15 +01:00
Bill Somerville
34bfebf1bd
Squash some warnings 2019-07-03 00:58:27 +01:00
Bill Somerville
ccac8c4f6e
Squash a couple of warnings 2019-07-03 00:03:02 +01:00
sirhc808
1f57ba5fec improve physical structure 2019-07-02 12:45:05 -05:00
Bill Somerville
350391d66e AAdded audio o/p category to playback options 2019-05-11 16:43:48 +01:00
Bill Somerville
c393740b0a Fix an off by error 2019-05-11 01:57:56 +01:00
Bill Somerville
8d6c7649e0 Repaired a defect in the calculation of delay before starting audio streams 2019-05-10 20:31:16 +01:00
Bill Somerville
62f9b32758 Added playback to record_time_signal tool
The tool may be started with either '-o <file-path>' to record or with
'-i  <file-path>',  where  file-path  is an  existing  .WAV  file,  to
playback  audio. Audio  output devices  may  be listed  with the  '-O'
option  and selected  by index  number using  the '-P  <device-index>'
option. No format conversions are done for playback by the tool so the
output device  must support  the format  of the  input .WAV  file. The
playback duration is the duration of the input .WAV file.

The tool '-s <start-second-in-minute>' option is now optional, without
it recording  or playback  starts immediately. So  to playback  a .WAV
file:

    $ record_time_signal -i wwv.wav

To play back the same file stating at second 55 in the minute:

   $ record_time_signal -i wwv.wav -s 55

Use the '-h' option for more help.
2019-05-10 19:38:04 +01:00
Bill Somerville
3a3af42cc6 Tool to exercise QAudioInput
The tool record_time_signal is designed  to measure the performance of
QAudioInput. The  intended use  is to  record a  short period  of live
audio from  an on-air time  signal of  known good quaility,  the basic
required parameters  are an  audio input device,  an output  file name
(.WAV), a start second in a minute,  and a duration in seconds. So for
example to record  the time signal ticks  and fast data at  the top of
the minute:

    $ record_time_signal -o wwv.wav -s 55 -d 15

will record  15s of  audio at  48000Hz sample  rate, stereo,  from the
default audio  input device, starting  at second  55. This will  use a
separate timer  to stop  the recording  which is  likely to  leave the
output file a little short due  to buffer latency. The buffer size can
be adjusted using the '-b <buffered-frames>' option.

The tool  also supoorts  a different mechanism  to time  the recording
which uses the audio progress via  a notify signal. This should ensure
at least  the requested  duration is recorded  The shorter  the notify
interval  the  closer teh  final  size  shoould  be to  the  requested
duration.  Use the  '-d  <interval-ms>' option  to  adjust the  notify
interval.

    $ record_time_signal -o wwv.wav -s 55 -d 15 -n 100

Non-default audio devices can be selected, use the '-I' option to list
the available input  devices with an index number that  can be used to
select the device using the 'R <device-number>' option.

Other options are available, use '-h' for details.
2019-05-10 17:27:52 +01:00
Bill Somerville
0b03ad4c09 Fix a potential crashes in BWF (WAV) file writes 2018-11-11 19:05:15 +00:00
Bill Somerville
8e43af11e5 Fix numerous memory leaks and uses of uninitialized variables
These were discovered when running under teh valgrind MemCheck tool. I
have also  checked in a suppressions  file (wsjtx-valgrind.linux.supp)
suitable for use on Linux when running the valgrind MemCheck tool.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6755 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-06-10 15:54:16 +00:00
Bill Somerville
4a33a696ba Enhanced error reporting for BWF (WAV) files
The BWFFile class  correctly indicates errors like  file access issues
and problems reading or writing headers using the BWFFile::error() and
BWFFile::errorString() operations.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6751 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-06-09 23:39:33 +00:00
Bill Somerville
64f1de08c8 Squash another warning
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6596 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-04-07 00:02:24 +00:00
Bill Somerville
720412ff5a Squash some more warnings
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6595 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-04-06 23:30:32 +00:00
Bill Somerville
e565e1796a Clean up some compiler warnings
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6591 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-04-06 22:37:22 +00:00
Bill Somerville
a3c1c768ef Fix some compiler warnings and error
Clang++ detected some warnings that g++ did not.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6409 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-01-20 20:32:30 +00:00
Bill Somerville
0f59c63ea6 Fix a regression in WAV file writing from r6383
WAV files were written with an incorrect fomat chunk average bytes per
second field.  This only effects  a few  media players like  WMP, most
ignore this field.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6405 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-01-19 19:06:12 +00:00
Bill Somerville
9301347f8a Better naming WavFile ->BWFFile
Broadcast  Wave  Format is  a  backwards  compatible superset  of  teh
Microsoft WAV file  format that has been implemented in  teh hope that
Windows File Explorer might show the WAV file metadta, as it turns out
that is not the case but as it's done anyway.

It appears to be  impossible to write a WAV file  such that MS Windows
File Explorer shows any metadata so  unless we adopt FLAC format audio
files we will have to show metadata with our own software :(

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6384 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-01-11 15:00:53 +00:00
Bill Somerville
4e6de783b0 Use new WAV file class (BWFFile) read and write WAV files
Saved WAV files now contain some useful metadata.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6383 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-01-11 15:00:43 +00:00
Bill Somerville
7b7ef610b5 Fix integer size and sign issues
WAV files use 32-bit sizes so casts are needed on 64-bit files systems

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6340 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-01-02 19:10:16 +00:00
Bill Somerville
58aacc590e Class to read and write WAV format files
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6337 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-01-02 17:19:49 +00:00