Changeset 92234 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Nov 5, 2021 8:44:14 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp
r92211 r92234 803 803 cbRecTotal += cbRecorded; /* Do a bit of accounting. */ 804 804 805 /* Always write (record) everything, no matter if the current audio contains complete silence or not.806 * Might be also become handy later if we want to have a look at start/stop timings and so on. */807 rc = AudioTestObjWrite(Obj, abSamples, cbRecorded);808 AssertRCBreak(rc);809 810 805 switch (enmState) 811 806 { … … 819 814 bool const fStarted = AudioTestBeaconGetRemaining(&Beacon) == AudioTestBeaconGetSize(&Beacon); 820 815 821 /* Limit adding data to the beacon size. */ 822 uint32_t const cbToAddMax = RT_MIN(cbRecorded, AudioTestBeaconGetRemaining(&Beacon)); 823 824 AudioTestBeaconAddConsecutive(&Beacon, abSamples, cbToAddMax); 825 /** @todo Take left-over data into account (and stash them away for the test tone)? */ 816 size_t uOff; 817 rc = AudioTestBeaconAddConsecutive(&Beacon, abSamples, cbRecorded, &uOff); 818 if (RT_SUCCESS(rc)) 819 { 820 /* 821 * When being in the AUDIOTESTSTATE_PRE state, we might get more audio data 822 * than we need for the pre-beacon to complete. In other words, that "more data" 823 * needs to be counted to the actual recorded test tone data then. 824 */ 825 if (enmState == AUDIOTESTSTATE_PRE) 826 cbTestRec += cbRecorded - (uint32_t)uOff; 827 } 826 828 827 829 if ( fStarted … … 852 854 * Currently we don't, as otherwise consequtively played tones will be cut off in the end. */ 853 855 if (!fIsAllSilence) 856 { 857 uint32_t const cbToAddMax = cbTestToRec - cbTestRec; 858 859 /* Don't read more than we're told to. 860 * After the actual test tone data there might come a post beacon which also 861 * needs to be handled in the AUDIOTESTSTATE_POST state then. */ 862 if (cbRecorded > cbToAddMax) 863 cbRecorded = cbToAddMax; 864 854 865 cbTestRec += cbRecorded; 866 } 855 867 856 868 if (cbTestToRec - cbTestRec == 0) /* Done recording the test tone? */ … … 874 886 } 875 887 876 if (enmState == AUDIOTESTSTATE_DONE) 888 if (cbRecorded) 889 { 890 /* Always write (record) everything, no matter if the current audio contains complete silence or not. 891 * Might be also become handy later if we want to have a look at start/stop timings and so on. */ 892 rc = AudioTestObjWrite(Obj, abSamples, cbRecorded); 893 AssertRCBreak(rc); 894 } 895 896 if (enmState == AUDIOTESTSTATE_DONE) /* Bail out when in state "done". */ 877 897 break; 878 898 }
Note:
See TracChangeset
for help on using the changeset viewer.