Skip to content

Commit b2bd9c8

Browse files
committed
Merge pull request #55 from mikrosimage/dev_mediaAnalyserAnalyseSilence
mediaAnalyser app: the readers generate silence if there is no more data to decode
2 parents 916f9a9 + 1be98eb commit b2bd9c8

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

INSTALL.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ scons --help
2121
```
2222

2323

24+
## Test
25+
26+
C++ tests, based on [GTest](https://github.com/google/googletest) framework, are used to check the loudness analysis with the EBU test material.
27+
28+
#### Run tests
29+
```
30+
scons test
31+
```
32+
33+
2434
## Dependencies
2535

2636
#### Libraries
@@ -54,7 +64,7 @@ To analyse and correct given audio files.
5464
Simple GUI to analyse and correct given audio files.
5565

5666
* __loudness-media-analyser__
57-
*External dependencies to [avtranscoder](https://github.com/avTranscoder/avTranscoder).*
67+
*External dependencies to [avtranscoder](https://github.com/avTranscoder/avTranscoder) v0.9.2 or upper.*
5868
To analyse audio in given files of any types.
5969

6070
## Tested compilers

USAGE.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,28 @@
44
Analyse the loudness of the given file.
55

66
```
7-
./build/release/loudness-analyser
7+
./install/bin/loudness-analyser
88
```
99

1010
#### Corrector
1111
Correct the loudness of the given file.
1212

1313
```
14-
./build/release/loudness-corrector
14+
./install/bin/loudness-corrector
1515
```
1616

1717
#### Validator
1818
A GUI which enables to analyse, visualize and correct the loudness.
1919

2020
```
21-
./build/release/loudness-validator
21+
./install/bin/loudness-validator
22+
```
23+
24+
#### Media analyser
25+
Analyse the loudness of the set of streams defined in a given configuration file.
26+
The application is able to extract audio from a file with other type of streams (video, data...).
27+
It is based on [avtranscoder](https://github.com/avTranscoder/avTranscoder).
28+
29+
```
30+
./install/bin/media-loudness-analyser
2231
```

app/mediaAnalyser/AvSoundFile.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ AvSoundFile::AvSoundFile(const std::vector<AudioElement>& arrayToAnalyse)
6565

6666
// Create reader to convert to float planar
6767
avtranscoder::AudioReader* reader = new avtranscoder::AudioReader(*inputFile, streamIndex, channelIndex);
68+
reader->continueWithGenerator();
6869
_audioReader.push_back(reader);
6970

7071
// Get data from audio stream
@@ -141,11 +142,8 @@ void AvSoundFile::analyse(Loudness::analyser::LoudnessAnalyser& analyser)
141142
{
142143
newTotalNbSamplesToAnalyse += _forceDurationToAnalyse * _inputSampleRate.at(i) * _inputNbChannels.at(i);
143144
}
144-
// the forced number of samples cannot be superior to the existing number of samples!
145-
if(newTotalNbSamplesToAnalyse < _totalNbSamplesToAnalyse)
146-
{
147-
_totalNbSamplesToAnalyse = newTotalNbSamplesToAnalyse;
148-
}
145+
// set total number of samples to analyse
146+
_totalNbSamplesToAnalyse = newTotalNbSamplesToAnalyse;
149147
}
150148

151149
// open file to print duration

0 commit comments

Comments
 (0)