Re: [PATCH spice-server 4/4] test-playback: Simplify wave generation formulae

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> remove the last e above
> 
> On 12/21/18 10:58 AM, Frediano Ziglio wrote:
> > Split level computation, make clear is a sine wave on both channels.
> 
> I don't understand what you mean in the second part of the sentence.
>

A "sine wave" is a mathematical formulae, channels are the audio channels.
The original formulae was confusing, now one line compute the sine wave,
the other set the sine wave results in both channels.
 
> > 
> > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> Acked-by: Uri Lublin <uril@xxxxxxxxxx>
> 

Thanks

> Uri.
> 
> > ---
> >   server/tests/test-playback.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/server/tests/test-playback.c b/server/tests/test-playback.c
> > index 87469c8e..290c8609 100644
> > --- a/server/tests/test-playback.c
> > +++ b/server/tests/test-playback.c
> > @@ -89,7 +89,8 @@ static void playback_timer_cb(SPICE_GNUC_UNUSED void
> > *opaque)
> >       while (samples_to_send > num_samples && frame) {
> >           samples_to_send -= num_samples;
> >           for (i = 0 ; i < num_samples; ++i) {
> > -            frame[i] = (((uint16_t)((1<<14)*sin((t+i)/10))) << 16) +
> > (((uint16_t)((1<<14)*sin((t+i)/10))));
> > +            uint16_t level = (1<<14) * sin((t+i)/10.0);
> > +            frame[i] = (level << 16) + level;
> >           }
> >           t += num_samples;
> >           spice_server_playback_put_samples(&playback_instance, frame);
> > 
> 
> 
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]