1
------------------------------------------------------------------------
4
(edi-18) Intelligent system for setting the internal sample rate.
5
- submitted: smassy, 17.10.2001
6
- done: kaiv, 31.01.2002
8
------------------------------------------------------------------------
11
- added: edi-18 implemented; engine samplerate is now
12
set automatically - if object sample rates don't
13
match, an error is printed
14
- added: ecasoundrc - 'default-audio-format'; same syntax
15
as with the -f option; defaults to s16_le,2,44100,i
16
- removed: ecasoundrc - 'default-samplerate'
17
- removed: -sr option; not needed anymore
19
------------------------------------------------------------------------
20
- S.Massy, 17.10.2001:
23
- When all objects have the same sr, use it as internal sr also.
24
- When objects have different sr always set internal sr equal to the highest
25
sr connected in the cs.
27
if (-i:48000 && -o:48000) { sr = 48000 }
28
if (-i:44100 && -o:22050 && -o:48000) { sr = 48000 }
30
That would improve ecasound's ease of use for many as well as its
31
apparent sound quality to a new user; because right now as soon as the
32
internal sr and the objects' sr differ, sound quality drops
33
dramatically because of the way ecasound converts sr's (as we
34
discussed on the list a while ago.)
35
Also maybe something similar should be done for rt objects. Because
36
if you have something like `-i:test.wav -o:alsa" though test.wav is at
37
a sample rate of 11025, alsa device is still open at 44100; ideally,
38
-f and -sr should only be used to override (or for headerless
42
------------------------------------------------------------------------
44
- should be placed to ECA_CHAINSETUP::enable() (after input
46
- ECA_ENGINE takes caref of initializing chains, so it's
48
- issue a warning if -sr was not given and resampling results
50
------------------------------------------------------------------------
54
What if we just removed implicit resampling altogether? My reasoning
57
- current resampling is not high-quality (mostly just causes
59
- for any kind of realtime work, resampling should _not_
60
be used (wastes cpu-resource for no good reason)
61
- only real use for resampling is file format conversions
62
- by removing the "resampling_needed()" check we
63
make the common code path a little bit faster (although
65
- we avoid problems with unexpected resampling
67
As a result you could not execute a chainsetup, where sampling rate of
68
one or more objects differs from engine's sampling rate.
70
If this was done, implementation of 'edi-18' would be reduced to:
72
- find the common sampling rate between audio objects
73
- if found: set engine's rate to it
74
- else: print an error message
76
This would also make the -sr option obsolete.
78
For cases where resampling is needed, a new audio object type could be
79
added - something like:
81
ecasound -f:16,2,44100 -i resample,22050hz_file.wav,44100 -o output.wav
83
As a bonus, as now resampling would be a special-case operation, we are
84
not limited to light resampling algorithms. In practise we could use a
85
much more high-quality (=cpu-heavy) alternative (if someone has the time
b'\\ No newline at end of file'