Patch (rather for discussion): sonic and samplerate implementation
Bohdan R. Rau
ethanak at polip.com
Tue Dec 7 09:35:03 CET 2010
On Mon, 6 Dec 2010 20:33:14 +0100, Andrei Kholodnyi
<andrei.kholodnyi at gmail.com> wrote:
>> It was necessary to add some code to ivona.c (like UPDATE_PARAMETER).
> why? since it does nothing, why do you need it in ivona.c?
Hm... on my system these changes in ivona.c allows to change rate/pitch.
It was not implemented in original ivona.c, as Ivona-1 server does not
allow to change pitch and rate, and even new Ivona-2 (probably will be
never shipped for Linux) can't change pitch.
But may be I have non typical system ;)
>>> Function spd_audio_effect you have implemented should probably pass
>>> AudioTrack instead of samples.
>> You mean somethink like:
>> int spd_audio_effect(AudioTrack *track,...)
> yes, something like
> AudioTrack * spd_audio_effect(AudioTrack *track,...)
> since you need an output as well.
Hm... I must rethink it (I don't think I like this solution).
But may be we should be more radical?
As we have only some modules - there is no problem to add some lines to
each module. For me it should be:
a) something like spd_audio_track_init(track) - fills all track structure
b) move third parameter of spd_audio_play into field in track structure
c) change second parameter od spd_audio_play from AudioTrack into
AudioTrack * so we can safely change size of AudioTrack structure
Then spd_audio_effect function could only manipulate some extended
AudioTrack fields (rate, pitch, contrast, may be equalizer...), and all
needed data manipulations would be done inside spd_audio_play?
There should be not too much work...
BTW regarding contrast:
I think changing contrast via speech-dispather API is not needed. In fact,
increasing contrast has meaning primarily with low-end audio system (my
Aspire One netbook is very good candidate as it has something strange
instead of speakers), so it may be left as parameter in module
In other hand - we could make contrast with volume working together (it
has sense as contrast increases loudness) - for example (the value 80 is
taken as example only):
effective_volume=(volume>80)?80:volume; /* 80 means "maximum" */
effective_contrast=(volume>80)?5*(volume-80):0; /* or compute
effective_contrast with "comtrast" from module configuration and volume */
What's your opinion?
http://milena.polip.com/ - Pa pa, Ivonko!
More information about the Speechd